Skip to content

Commit 61cf267

Browse files
committed
Factor goto_symext::symex_dead
We'll use the symex_dead overload that takes a symbol expression rather than an instruction to kill let-bound local definitions
1 parent a5321d6 commit 61cf267

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/goto-symex/goto_symex.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ class goto_symext
321321
/// Symbolically execute a DEAD instruction
322322
/// \param state: Symbolic execution state for current instruction
323323
virtual void symex_dead(statet &state);
324+
/// Kill a symbol, as if it had been the subject of a DEAD instruction
325+
/// \param state: Symbolic execution state
326+
/// \param symbol_expr: Symbol to kill
327+
void symex_dead(statet &state, const symbol_exprt &symbol_expr);
324328
/// Symbolically execute an OTHER instruction
325329
/// \param state: Symbolic execution state for current instruction
326330
virtual void symex_other(statet &state);

src/goto-symex/symex_dead.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ void goto_symext::symex_dead(statet &state)
2121
const goto_programt::instructiont &instruction=*state.source.pc;
2222

2323
const code_deadt &code = instruction.get_dead();
24+
symex_dead(state, code.symbol());
25+
}
2426

25-
ssa_exprt ssa = state.rename_ssa<L1>(ssa_exprt{code.symbol()}, ns).get();
27+
void goto_symext::symex_dead(statet &state, const symbol_exprt &symbol_expr)
28+
{
29+
ssa_exprt ssa = state
30+
.rename_ssa<L1>(
31+
is_ssa_expr(symbol_expr) ? to_ssa_expr(symbol_expr)
32+
: ssa_exprt{symbol_expr},
33+
ns)
34+
.get();
2635

2736
const exprt fields = state.field_sensitivity.get_fields(ns, state, ssa);
2837
find_symbols_sett fields_set;

0 commit comments

Comments
 (0)