@@ -188,7 +188,7 @@ void goto_checkt::div_by_zero_check(
188188
189189 // add divison by zero subgoal
190190
191- exprt zero=gen_zero ( expr.op1 ().type ());
191+ exprt zero=from_integer ( 0 , expr.op1 ().type ());
192192
193193 if (zero.is_nil ())
194194 throw " no zero of argument type of operator " +expr.id_string ();
@@ -233,7 +233,7 @@ void goto_checkt::undefined_shift_check(
233233 if (distance_type.id ()==ID_signedbv)
234234 {
235235 binary_relation_exprt inequality (
236- expr.distance (), ID_ge, gen_zero ( distance_type));
236+ expr.distance (), ID_ge, from_integer ( 0 , distance_type));
237237
238238 add_guarded_claim (
239239 inequality,
@@ -289,7 +289,7 @@ void goto_checkt::mod_by_zero_check(
289289
290290 // add divison by zero subgoal
291291
292- exprt zero=gen_zero ( expr.op1 ().type ());
292+ exprt zero=from_integer ( 0 , expr.op1 ().type ());
293293
294294 if (zero.is_nil ())
295295 throw " no zero of argument type of operator " +expr.id_string ();
@@ -802,8 +802,8 @@ void goto_checkt::nan_check(
802802 // 0/0 = NaN and x/inf = NaN
803803 // (note that x/0 = +-inf for x!=0 and x!=inf)
804804 exprt zero_div_zero=and_exprt (
805- ieee_float_equal_exprt (expr.op0 (), gen_zero ( expr.op0 ().type ())),
806- ieee_float_equal_exprt (expr.op1 (), gen_zero ( expr.op1 ().type ())));
805+ ieee_float_equal_exprt (expr.op0 (), from_integer ( 0 , expr.op0 ().type ())),
806+ ieee_float_equal_exprt (expr.op1 (), from_integer ( 0 , expr.op1 ().type ())));
807807
808808 exprt div_inf=unary_exprt (ID_isinf, expr.op1 (), bool_typet ());
809809
@@ -819,10 +819,10 @@ void goto_checkt::nan_check(
819819 // Inf * 0 is NaN
820820 exprt inf_times_zero=and_exprt (
821821 unary_exprt (ID_isinf, expr.op0 (), bool_typet ()),
822- ieee_float_equal_exprt (expr.op1 (), gen_zero ( expr.op1 ().type ())));
822+ ieee_float_equal_exprt (expr.op1 (), from_integer ( 0 , expr.op1 ().type ())));
823823
824824 exprt zero_times_inf=and_exprt (
825- ieee_float_equal_exprt (expr.op1 (), gen_zero ( expr.op1 ().type ())),
825+ ieee_float_equal_exprt (expr.op1 (), from_integer ( 0 , expr.op1 ().type ())),
826826 unary_exprt (ID_isinf, expr.op0 (), bool_typet ()));
827827
828828 isnan=or_exprt (inf_times_zero, zero_times_inf);
@@ -972,7 +972,8 @@ void goto_checkt::pointer_validity_check(
972972 return ;
973973
974974 const exprt &pointer=expr.op0 ();
975- const typet &pointer_type=to_pointer_type (ns.follow (pointer.type ()));
975+ const pointer_typet &pointer_type=
976+ to_pointer_type (ns.follow (pointer.type ()));
976977
977978 assert (base_type_eq (pointer_type.subtype (), expr.type (), ns));
978979
@@ -986,7 +987,7 @@ void goto_checkt::pointer_validity_check(
986987 {
987988 if (flags.is_unknown () || flags.is_null ())
988989 {
989- notequal_exprt not_eq_null (pointer, gen_zero (pointer. type () ));
990+ notequal_exprt not_eq_null (pointer, null_pointer_exprt (pointer_type ));
990991
991992 add_guarded_claim (
992993 not_eq_null,
@@ -1175,7 +1176,7 @@ void goto_checkt::bounds_check(
11751176 effective_offset=plus_exprt (p_offset, effective_offset);
11761177 }
11771178
1178- exprt zero=gen_zero ( ode.offset ().type ());
1179+ exprt zero=from_integer ( 0 , ode.offset ().type ());
11791180 assert (zero.is_not_nil ());
11801181
11811182 // the final offset must not be negative
@@ -1612,7 +1613,9 @@ void goto_checkt::goto_check(goto_functiont &goto_function)
16121613
16131614 if (flags.is_unknown () || flags.is_null ())
16141615 {
1615- notequal_exprt not_eq_null (pointer, gen_zero (pointer.type ()));
1616+ notequal_exprt not_eq_null (
1617+ pointer,
1618+ null_pointer_exprt (to_pointer_type (pointer.type ())));
16161619
16171620 add_guarded_claim (
16181621 not_eq_null,
@@ -1651,7 +1654,9 @@ void goto_checkt::goto_check(goto_functiont &goto_function)
16511654
16521655 if (pointer.type ().subtype ().get (ID_identifier)!=" java::java.lang.AssertionError" )
16531656 {
1654- notequal_exprt not_eq_null (pointer, gen_zero (pointer.type ()));
1657+ notequal_exprt not_eq_null (
1658+ pointer,
1659+ null_pointer_exprt (to_pointer_type (pointer.type ())));
16551660
16561661 add_guarded_claim (
16571662 not_eq_null,
@@ -1718,7 +1723,9 @@ void goto_checkt::goto_check(goto_functiont &goto_function)
17181723 source_locationt source_location;
17191724 source_location.set_function (i.function );
17201725
1721- equal_exprt eq (leak_expr, gen_zero (ns.follow (leak.type )));
1726+ equal_exprt eq (
1727+ leak_expr,
1728+ null_pointer_exprt (to_pointer_type (leak.type )));
17221729 add_guarded_claim (
17231730 eq,
17241731 " dynamically allocated memory never freed" ,
0 commit comments