@@ -128,7 +128,7 @@ void goto_symext::symex_other(
128
128
statement==ID_array_replace)
129
129
{
130
130
// array_copy and array_replace take two pointers (to arrays); we need to:
131
- // 1. dereference the pointers (via clean_expr)
131
+ // 1. remove any dereference expressions (via clean_expr)
132
132
// 2. find the actual array objects/candidates for objects (via
133
133
// process_array_expr)
134
134
// 3. build an assignment where the type on lhs and rhs is:
@@ -139,14 +139,14 @@ void goto_symext::symex_other(
139
139
" expected array_copy/array_replace statement to have two operands" );
140
140
141
141
// we need to add dereferencing for both operands
142
- dereference_exprt dest_array (code.op0 ());
143
- clean_expr (dest_array, state, true );
144
- dereference_exprt src_array (code.op1 ());
142
+ exprt dest_array (code.op0 ());
143
+ clean_expr (dest_array, state, false );
144
+ exprt src_array (code.op1 ());
145
145
clean_expr (src_array, state, false );
146
146
147
147
// obtain the actual arrays
148
- process_array_expr (dest_array);
149
- process_array_expr (src_array);
148
+ process_array_expr (state, dest_array, true );
149
+ process_array_expr (state, src_array, false );
150
150
151
151
// check for size (or type) mismatch and adjust
152
152
if (!base_type_eq (dest_array.type (), src_array.type (), ns))
@@ -181,7 +181,7 @@ void goto_symext::symex_other(
181
181
{
182
182
// array_set takes a pointer (to an array) and a value that each element
183
183
// should be set to; we need to:
184
- // 1. dereference the pointer (via clean_expr)
184
+ // 1. remove any dereference expressions (via clean_expr)
185
185
// 2. find the actual array object/candidates for objects (via
186
186
// process_array_expr)
187
187
// 3. use the type of the resulting array to construct an array_of
@@ -191,11 +191,11 @@ void goto_symext::symex_other(
191
191
" expected array_set statement to have two operands" );
192
192
193
193
// we need to add dereferencing for the first operand
194
- exprt array_expr = dereference_exprt (code.op0 ());
195
- clean_expr (array_expr, state, true );
194
+ exprt array_expr (code.op0 ());
195
+ clean_expr (array_expr, state, false );
196
196
197
197
// obtain the actual array(s)
198
- process_array_expr (array_expr);
198
+ process_array_expr (state, array_expr, true );
199
199
200
200
// prepare to build the array_of
201
201
exprt value = code.op1 ();
@@ -227,7 +227,7 @@ void goto_symext::symex_other(
227
227
{
228
228
// array_equal takes two pointers (to arrays) and the symbol that the result
229
229
// should get assigned to; we need to:
230
- // 1. dereference the pointers (via clean_expr)
230
+ // 1. remove any dereference expressions (via clean_expr)
231
231
// 2. find the actual array objects/candidates for objects (via
232
232
// process_array_expr)
233
233
// 3. build an assignment where the lhs is the previous third argument, and
@@ -238,14 +238,14 @@ void goto_symext::symex_other(
238
238
" expected array_equal statement to have three operands" );
239
239
240
240
// we need to add dereferencing for the first two
241
- dereference_exprt array1 (code.op0 ());
241
+ exprt array1 (code.op0 ());
242
242
clean_expr (array1, state, false );
243
- dereference_exprt array2 (code.op1 ());
243
+ exprt array2 (code.op1 ());
244
244
clean_expr (array2, state, false );
245
245
246
246
// obtain the actual arrays
247
- process_array_expr (array1);
248
- process_array_expr (array2);
247
+ process_array_expr (state, array1, false );
248
+ process_array_expr (state, array2, false );
249
249
250
250
code_assignt assignment (code.op2 (), equal_exprt (array1, array2));
251
251
@@ -271,10 +271,10 @@ void goto_symext::symex_other(
271
271
code.operands ().size () == 1 ,
272
272
" expected havoc_object statement to have one operand" );
273
273
274
- // we need to add dereferencing for the first operand
275
- dereference_exprt object (code.op0 (), empty_typet ());
276
- clean_expr (object, state, true );
274
+ exprt object (code.op0 ());
275
+ clean_expr (object, state, false );
277
276
277
+ process_array_expr (state, object, true );
278
278
havoc_rec (state, guardt (true_exprt ()), object);
279
279
}
280
280
else
0 commit comments