-
Notifications
You must be signed in to change notification settings - Fork 273
Split the rename function according to the level and pass expression by copy instead of reference #3996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split the rename function according to the level and pass expression by copy instead of reference #3996
Changes from 1 commit
cf26fd0
137b635
7553ca7
9d18229
3726631
7da918f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,8 +53,8 @@ void goto_symext::symex_decl(statet &state, const symbol_exprt &expr) | |
else | ||
rhs=exprt(ID_invalid); | ||
|
||
state.rename<goto_symex_statet::L1>(rhs, ns); | ||
state.value_set.assign(ssa, rhs, ns, true, false); | ||
exprt l1_rhs = state.rename<goto_symex_statet::L1>(std::move(rhs), ns); | ||
state.value_set.assign(ssa, l1_rhs, ns, true, false); | ||
} | ||
|
||
// prevent propagation | ||
|
@@ -69,7 +69,11 @@ void goto_symext::symex_decl(statet &state, const symbol_exprt &expr) | |
symex_renaming_levelt::increase_counter(level2_it); | ||
const bool record_events=state.record_events; | ||
state.record_events=false; | ||
state.rename(ssa, ns); | ||
exprt expr_l2 = state.rename(std::move(ssa), ns); | ||
INVARIANT( | ||
expr_l2.id() == ID_symbol && expr_l2.get_bool(ID_C_SSA_symbol), | ||
"symbol to declare should not be replaced by constant propagation"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, but unrelated to the other changes here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need these conditions to be sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, indeed that possible problem was hidden before. But |
||
ssa = to_ssa_expr(expr_l2); | ||
state.record_events=record_events; | ||
|
||
// we hide the declaration of auxiliary variables | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: you otherwise aim to use
{...}
in constructor calls, so dossa_exprt{expr}
here as well.