File tree 2 files changed +15
-13
lines changed
2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -47,19 +47,19 @@ literalt bv_pointerst::convert_rest(const exprt &expr)
47
47
}
48
48
else if (expr.id ()==ID_is_dynamic_object)
49
49
{
50
- if (operands.size ()==1 &&
51
- operands[0 ].type ().id ()==ID_pointer)
52
- {
53
- // we postpone
54
- literalt l=prop.new_variable ();
50
+ DATA_INVARIANT (operands.size () == 1 &&
51
+ operands[0 ].type ().id () == ID_pointer,
52
+ std::string (" is_dynamic_object_exprt should have one" ) +
53
+ " operand, which should have pointer type." );
54
+ // we postpone
55
+ literalt l=prop.new_variable ();
55
56
56
- postponed_list.push_back (postponedt ());
57
- postponed_list.back ().op =convert_bv (operands[0 ]);
58
- postponed_list.back ().bv .push_back (l);
59
- postponed_list.back ().expr =expr;
57
+ postponed_list.push_back (postponedt ());
58
+ postponed_list.back ().op =convert_bv (operands[0 ]);
59
+ postponed_list.back ().bv .push_back (l);
60
+ postponed_list.back ().expr =expr;
60
61
61
- return l;
62
- }
62
+ return l;
63
63
}
64
64
else if (expr.id ()==ID_lt || expr.id ()==ID_le ||
65
65
expr.id ()==ID_gt || expr.id ()==ID_ge)
Original file line number Diff line number Diff line change @@ -510,8 +510,10 @@ bool simplify_exprt::simplify_pointer_object(exprt &expr)
510
510
511
511
bool simplify_exprt::simplify_is_dynamic_object (exprt &expr)
512
512
{
513
- // This should hold as a result of the expr ID being is_dynamic_object.
514
- PRECONDITION (expr.operands ().size () == 1 );
513
+ DATA_INVARIANT (expr.operands ().size () == 1 &&
514
+ expr.op0 ().type ().id () == ID_pointer,
515
+ std::string (" is_dynamic_object_exprt should have one" ) +
516
+ " operand, which should have pointer type." );
515
517
516
518
exprt &op=expr.op0 ();
517
519
You can’t perform that action at this time.
0 commit comments