@@ -89,26 +89,22 @@ void goto_symext::symex_other(
89
89
else if (statement==ID_cpp_delete ||
90
90
statement==" cpp_delete[]" )
91
91
{
92
- codet clean_code=code;
93
- clean_expr (clean_code, state, false );
92
+ const codet clean_code = to_code (clean_expr (code, state, false ));
94
93
symex_cpp_delete (state, clean_code);
95
94
}
96
95
else if (statement==ID_printf)
97
96
{
98
- codet clean_code=code;
99
- clean_expr (clean_code, state, false );
97
+ const codet clean_code = to_code (clean_expr (code, state, false ));
100
98
symex_printf (state, clean_code);
101
99
}
102
100
else if (statement==ID_input)
103
101
{
104
- codet clean_code (code);
105
- clean_expr (clean_code, state, false );
102
+ const codet clean_code = to_code (clean_expr (code, state, false ));
106
103
symex_input (state, clean_code);
107
104
}
108
105
else if (statement==ID_output)
109
106
{
110
- codet clean_code (code);
111
- clean_expr (clean_code, state, false );
107
+ const codet clean_code = to_code (clean_expr (code, state, false ));
112
108
symex_output (state, clean_code);
113
109
}
114
110
else if (statement==ID_decl)
@@ -138,10 +134,8 @@ void goto_symext::symex_other(
138
134
" expected array_copy/array_replace statement to have two operands" );
139
135
140
136
// we need to add dereferencing for both operands
141
- exprt dest_array (code.op0 ());
142
- clean_expr (dest_array, state, false );
143
- exprt src_array (code.op1 ());
144
- clean_expr (src_array, state, false );
137
+ exprt dest_array = clean_expr (code.op0 (), state, false );
138
+ exprt src_array = clean_expr (code.op1 (), state, false );
145
139
146
140
// obtain the actual arrays
147
141
process_array_expr (state, dest_array);
@@ -190,15 +184,13 @@ void goto_symext::symex_other(
190
184
" expected array_set statement to have two operands" );
191
185
192
186
// we need to add dereferencing for the first operand
193
- exprt array_expr (code.op0 ());
194
- clean_expr (array_expr, state, false );
187
+ exprt array_expr = clean_expr (code.op0 (), state, false );
195
188
196
189
// obtain the actual array(s)
197
190
process_array_expr (state, array_expr);
198
191
199
192
// prepare to build the array_of
200
- exprt value = code.op1 ();
201
- clean_expr (value, state, false );
193
+ exprt value = clean_expr (code.op1 (), state, false );
202
194
203
195
// we might have a memset-style update of a non-array type - convert to a
204
196
// byte array
@@ -237,10 +229,8 @@ void goto_symext::symex_other(
237
229
" expected array_equal statement to have three operands" );
238
230
239
231
// we need to add dereferencing for the first two
240
- exprt array1 (code.op0 ());
241
- clean_expr (array1, state, false );
242
- exprt array2 (code.op1 ());
243
- clean_expr (array2, state, false );
232
+ exprt array1 = clean_expr (code.op0 (), state, false );
233
+ exprt array2 = clean_expr (code.op1 (), state, false );
244
234
245
235
// obtain the actual arrays
246
236
process_array_expr (state, array1);
@@ -270,8 +260,7 @@ void goto_symext::symex_other(
270
260
code.operands ().size () == 1 ,
271
261
" expected havoc_object statement to have one operand" );
272
262
273
- exprt object (code.op0 ());
274
- clean_expr (object, state, false );
263
+ exprt object = clean_expr (code.op0 (), state, false );
275
264
276
265
process_array_expr (state, object);
277
266
havoc_rec (state, guardt (true_exprt (), guard_manager), object);
0 commit comments