Skip to content

Commit bb64ea6

Browse files
author
Daniel Kroening
committed
clean up symex_assign vs. symex_assign_rec
1 parent 932a38f commit bb64ea6

6 files changed

+14
-27
lines changed

src/goto-symex/auto_objects.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void goto_symext::initialize_auto_object(
7676
address_of_expr);
7777

7878
code_assignt assignment(expr, rhs);
79-
symex_assign_rec(state, assignment);
79+
symex_assign(state, assignment);
8080
}
8181
}
8282
}

src/goto-symex/goto_symex.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ class goto_symext
305305
virtual void do_simplify(exprt &expr);
306306

307307
// virtual void symex_block(statet &state, const codet &code);
308-
void symex_assign_rec(statet &state, const code_assignt &code);
309-
virtual void symex_assign(statet &state, const code_assignt &code);
308+
void symex_assign(statet &state, const code_assignt &code);
310309

311310
// havocs the given object
312311
void havoc_rec(statet &, const guardt &, const exprt &);

src/goto-symex/symex_assign.cpp

+2-14
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,15 @@ Author: Daniel Kroening, [email protected]
2020

2121
// #define USE_UPDATE
2222

23-
void goto_symext::symex_assign_rec(
24-
statet &state,
25-
const code_assignt &code)
26-
{
27-
code_assignt deref_code=code;
28-
29-
clean_expr(deref_code.lhs(), state, true);
30-
clean_expr(deref_code.rhs(), state, false);
31-
32-
symex_assign(state, deref_code);
33-
}
34-
3523
void goto_symext::symex_assign(
3624
statet &state,
3725
const code_assignt &code)
3826
{
3927
exprt lhs=code.lhs();
4028
exprt rhs=code.rhs();
4129

42-
replace_nondet(lhs);
43-
replace_nondet(rhs);
30+
clean_expr(lhs, state, true);
31+
clean_expr(rhs, state, false);
4432

4533
if(rhs.id()==ID_side_effect)
4634
{

src/goto-symex/symex_builtin_functions.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void goto_symext::symex_allocate(
151151
code_assignt assignment(size_symbol.symbol_expr(), size);
152152
size=assignment.lhs();
153153

154-
symex_assign_rec(state, assignment);
154+
symex_assign(state, assignment);
155155
}
156156
}
157157

@@ -187,7 +187,7 @@ void goto_symext::symex_allocate(
187187
if(zero_value.is_not_nil())
188188
{
189189
code_assignt assignment(value_symbol.symbol_expr(), zero_value);
190-
symex_assign_rec(state, assignment);
190+
symex_assign(state, assignment);
191191
}
192192
else
193193
throw "failed to zero initialize dynamic object";
@@ -212,7 +212,7 @@ void goto_symext::symex_allocate(
212212
if(rhs.type()!=lhs.type())
213213
rhs.make_typecast(lhs.type());
214214

215-
symex_assign_rec(state, code_assignt(lhs, rhs));
215+
symex_assign(state, code_assignt(lhs, rhs));
216216
}
217217

218218
irep_idt get_symbol(const exprt &src)
@@ -276,7 +276,7 @@ void goto_symext::symex_gcc_builtin_va_arg_next(
276276
}
277277
}
278278

279-
symex_assign_rec(state, code_assignt(lhs, rhs));
279+
symex_assign(state, code_assignt(lhs, rhs));
280280
}
281281

282282
irep_idt get_string_argument_rec(const exprt &src)
@@ -458,7 +458,7 @@ void goto_symext::symex_cpp_new(
458458
else
459459
rhs.copy_to_operands(symbol.symbol_expr());
460460

461-
symex_assign_rec(state, code_assignt(lhs, rhs));
461+
symex_assign(state, code_assignt(lhs, rhs));
462462
}
463463

464464
void goto_symext::symex_cpp_delete(

src/goto-symex/symex_function_call.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void goto_symext::parameter_assignments(
130130
}
131131
}
132132

133-
symex_assign_rec(state, code_assignt(lhs, rhs));
133+
symex_assign(state, code_assignt(lhs, rhs));
134134
}
135135

136136
if(it1!=arguments.end())
@@ -162,7 +162,7 @@ void goto_symext::parameter_assignments(
162162

163163
symbol_exprt lhs=symbol_exprt(id, it1->type());
164164

165-
symex_assign_rec(state, code_assignt(lhs, *it1));
165+
symex_assign(state, code_assignt(lhs, *it1));
166166
}
167167
}
168168
else if(it1!=arguments.end())
@@ -275,7 +275,7 @@ void goto_symext::symex_function_call_code(
275275
side_effect_expr_nondett rhs(call.lhs().type());
276276
rhs.add_source_location()=call.source_location();
277277
code_assignt code(call.lhs(), rhs);
278-
symex_assign_rec(state, code);
278+
symex_assign(state, code);
279279
}
280280

281281
symex_transition(state);
@@ -455,7 +455,7 @@ void goto_symext::return_assignment(statet &state)
455455
"assignment.lhs().type():\n"+assignment.lhs().type().pretty()+"\n"+
456456
"assignment.rhs().type():\n"+assignment.rhs().type().pretty();
457457

458-
symex_assign_rec(state, assignment);
458+
symex_assign(state, assignment);
459459
}
460460
}
461461
else

src/goto-symex/symex_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ void goto_symext::symex_step(
293293

294294
case ASSIGN:
295295
if(!state.guard.is_false())
296-
symex_assign_rec(state, to_code_assign(instruction.code));
296+
symex_assign(state, to_code_assign(instruction.code));
297297

298298
symex_transition(state);
299299
break;

0 commit comments

Comments
 (0)