@@ -464,11 +464,20 @@ void java_object_factoryt::gen_nondet_init(
464
464
}
465
465
else
466
466
{
467
- side_effect_expr_nondett se=side_effect_expr_nondett (type);
467
+ code_assignt assign;
468
+ assign.lhs ()=expr;
469
+ assign.add_source_location ()=loc;
468
470
469
- code_assignt code (expr, se);
470
- code.add_source_location ()=loc;
471
- init_code.copy_to_operands (code);
471
+ if (type.id ()==ID_c_bool)
472
+ {
473
+ assign.rhs ()=get_nondet_bool (type);
474
+ }
475
+ else
476
+ {
477
+ assign.rhs ()=side_effect_expr_nondett (type);
478
+ }
479
+
480
+ init_code.copy_to_operands (assign);
472
481
}
473
482
}
474
483
@@ -702,43 +711,29 @@ exprt object_factory(
702
711
const source_locationt &loc,
703
712
message_handlert &message_handler)
704
713
{
705
- if (type.id ()==ID_pointer)
706
- {
707
- symbolt &aux_symbol=new_tmp_symbol (
708
- symbol_table,
709
- loc,
710
- type);
711
- aux_symbol.is_static_lifetime =true ;
714
+ symbolt &aux_symbol=new_tmp_symbol (symbol_table, loc, type);
715
+ aux_symbol.is_static_lifetime =true ;
712
716
713
- exprt object=aux_symbol.symbol_expr ();
717
+ exprt object=aux_symbol.symbol_expr ();
714
718
715
- java_object_factoryt state (
716
- init_code,
717
- !allow_null,
718
- max_nondet_array_length,
719
- symbol_table,
720
- message_handler,
721
- loc);
722
- state.gen_nondet_init (
723
- object,
724
- false ,
725
- " " ,
726
- false ,
727
- false ,
728
- false ,
729
- typet (),
730
- NO_UPDATE_IN_PLACE);
719
+ java_object_factoryt state (
720
+ init_code,
721
+ !allow_null,
722
+ max_nondet_array_length,
723
+ symbol_table,
724
+ message_handler,
725
+ loc);
726
+ state.gen_nondet_init (
727
+ object,
728
+ false ,
729
+ " " ,
730
+ false ,
731
+ false ,
732
+ false ,
733
+ typet (),
734
+ NO_UPDATE_IN_PLACE);
731
735
732
- return object;
733
- }
734
- else if (type.id ()==ID_c_bool)
735
- {
736
- // We force this to 0 and 1 and won't consider
737
- // other values.
738
- return get_nondet_bool (type);
739
- }
740
- else
741
- return side_effect_expr_nondett (type);
736
+ return object;
742
737
}
743
738
744
739
/* ******************************************************************\
0 commit comments