@@ -58,7 +58,7 @@ void goto_symext::symex_allocate(
58
58
59
59
dynamic_counter++;
60
60
61
- exprt size= code.op0 ();
61
+ exprt size = to_binary_expr ( code) .op0 ();
62
62
optionalt<typet> object_type;
63
63
auto function_symbol = outer_symbol_table.lookup (state.source .function_id );
64
64
INVARIANT (function_symbol, " function associated with allocation not found" );
@@ -93,16 +93,19 @@ void goto_symext::symex_allocate(
93
93
else if (
94
94
!alloc_size.has_value () && tmp_size.id () == ID_mult &&
95
95
tmp_size.operands ().size () == 2 &&
96
- (tmp_size.op0 ().is_constant () || tmp_size.op1 ().is_constant ()))
96
+ (to_mult_expr (tmp_size).op0 ().is_constant () ||
97
+ to_mult_expr (tmp_size).op1 ().is_constant ()))
97
98
{
98
- exprt s= tmp_size.op0 ();
99
+ exprt s = to_mult_expr ( tmp_size) .op0 ();
99
100
if (s.is_constant ())
100
101
{
101
- s=tmp_size.op1 ();
102
- PRECONDITION (*c_sizeof_type_rec (tmp_size.op0 ()) == *tmp_type);
102
+ s = to_mult_expr (tmp_size).op1 ();
103
+ PRECONDITION (
104
+ *c_sizeof_type_rec (to_mult_expr (tmp_size).op0 ()) == *tmp_type);
103
105
}
104
106
else
105
- PRECONDITION (*c_sizeof_type_rec (tmp_size.op1 ()) == *tmp_type);
107
+ PRECONDITION (
108
+ *c_sizeof_type_rec (to_mult_expr (tmp_size).op1 ()) == *tmp_type);
106
109
107
110
object_type = array_typet (*tmp_type, s);
108
111
}
@@ -167,7 +170,7 @@ void goto_symext::symex_allocate(
167
170
state.symbol_table .add (value_symbol);
168
171
169
172
// to allow constant propagation
170
- exprt zero_init = state.rename (code.op1 (), ns).get ();
173
+ exprt zero_init = state.rename (to_binary_expr ( code) .op1 (), ns).get ();
171
174
simplify (zero_init, ns);
172
175
173
176
INVARIANT (
@@ -258,7 +261,7 @@ void goto_symext::symex_va_start(
258
261
259
262
// create an array holding pointers to the parameters, starting after the
260
263
// parameter that the operand points to
261
- const exprt &op = skip_typecast (code. op0 ());
264
+ const exprt &op = skip_typecast (to_unary_expr ( code). op ());
262
265
// this must be the address of a symbol
263
266
const irep_idt start_parameter =
264
267
to_ssa_expr (to_address_of_expr (op).object ()).get_object_name ();
0 commit comments