Skip to content

Commit 44d8f23

Browse files
committed
Clarify comments in symex_dead
Try to make clearer what we can(not) remove from renaming maps. Also do small cleanups of the code.
1 parent 937d557 commit 44d8f23

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/goto-symex/symex_dead.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "goto_symex.h"
1313

14-
#include <cassert>
15-
1614
#include <util/std_expr.h>
1715

1816
#include <pointer-analysis/add_failed_symbols.h>
@@ -23,9 +21,6 @@ void goto_symext::symex_dead(statet &state)
2321

2422
const code_deadt &code = instruction.get_dead();
2523

26-
// We increase the L2 renaming to make these non-deterministic.
27-
// We also prevent propagation of old values.
28-
2924
ssa_exprt ssa(code.symbol());
3025
state.rename(ssa, ns, goto_symex_statet::L1);
3126

@@ -45,13 +40,15 @@ void goto_symext::symex_dead(statet &state)
4540
state.value_set.assign(ssa, rhs, ns, true, false);
4641
}
4742

48-
ssa_exprt ssa_lhs=to_ssa_expr(ssa);
49-
const irep_idt &l1_identifier=ssa_lhs.get_identifier();
43+
const irep_idt &l1_identifier = to_ssa_expr(ssa).get_identifier();
5044

51-
// prevent propagation
45+
// we cannot remove the object from the L1 renaming map, because L1 renaming
46+
// information is not local to a path, but removing it from the propagation
47+
// map is safe as 1) it is local to a path and 2) this instance can no longer
48+
// appear
5249
state.propagation.erase(l1_identifier);
53-
54-
// L2 renaming
50+
// increment the L2 index to ensure a merge on join points will propagate the
51+
// value for branches that are still live
5552
auto level2_it = state.level2.current_names.find(l1_identifier);
5653
if(level2_it != state.level2.current_names.end())
5754
symex_renaming_levelt::increase_counter(level2_it);

0 commit comments

Comments
 (0)