@@ -356,11 +356,13 @@ void java_object_factoryt::gen_nondet_init(
356
356
}
357
357
else
358
358
{
359
- side_effect_expr_nondett se=side_effect_expr_nondett (type);
359
+ exprt rhs=type.id ()==ID_c_bool?
360
+ get_nondet_bool (type):
361
+ side_effect_expr_nondett (type);
362
+ code_assignt assign (expr, rhs);
363
+ assign.add_source_location ()=loc;
360
364
361
- code_assignt code (expr, se);
362
- code.add_source_location ()=loc;
363
- init_code.copy_to_operands (code);
365
+ init_code.copy_to_operands (assign);
364
366
}
365
367
}
366
368
@@ -517,36 +519,25 @@ exprt object_factory(
517
519
size_t max_nondet_array_length,
518
520
const source_locationt &loc)
519
521
{
520
- if (type.id ()==ID_pointer)
521
- {
522
- symbolt &aux_symbol=new_tmp_symbol (
523
- symbol_table,
524
- loc,
525
- type);
526
- aux_symbol.is_static_lifetime =true ;
522
+ symbolt &aux_symbol=new_tmp_symbol (
523
+ symbol_table,
524
+ loc,
525
+ type);
526
+ aux_symbol.is_static_lifetime =true ;
527
527
528
- exprt object=aux_symbol.symbol_expr ();
528
+ exprt object=aux_symbol.symbol_expr ();
529
529
530
- java_object_factoryt state (
531
- init_code,
532
- !allow_null,
533
- max_nondet_array_length,
534
- symbol_table);
535
- state.gen_nondet_init (
536
- object,
537
- false ,
538
- " " ,
539
- loc,
540
- false );
541
-
542
- return object;
543
- }
544
- else if (type.id ()==ID_c_bool)
545
- {
546
- // We force this to 0 and 1 and won't consider
547
- // other values.
548
- return get_nondet_bool (type);
549
- }
550
- else
551
- return side_effect_expr_nondett (type);
530
+ java_object_factoryt state (
531
+ init_code,
532
+ !allow_null,
533
+ max_nondet_array_length,
534
+ symbol_table);
535
+ state.gen_nondet_init (
536
+ object,
537
+ false ,
538
+ " " ,
539
+ loc,
540
+ false );
541
+
542
+ return object;
552
543
}
0 commit comments