-
Notifications
You must be signed in to change notification settings - Fork 273
Make return type of set_l*_indices be a renamedt [blocks: #4333] #3986
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
Changes from all commits
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 |
---|---|---|
|
@@ -46,8 +46,12 @@ operator()(ssa_exprt ssa_expr, const namespacet &ns, unsigned thread_nr) const | |
renamedt<ssa_exprt, L1> symex_level1t:: | ||
operator()(renamedt<ssa_exprt, L0> l0_expr) const | ||
{ | ||
if(!l0_expr.get().get_level_1().empty()) | ||
if( | ||
!l0_expr.get().get_level_1().empty() || | ||
!l0_expr.get().get_level_2().empty()) | ||
{ | ||
return renamedt<ssa_exprt, L1>{std::move(l0_expr.value)}; | ||
} | ||
|
||
const irep_idt l0_name = l0_expr.get().get_l1_object_identifier(); | ||
|
||
|
@@ -63,6 +67,8 @@ operator()(renamedt<ssa_exprt, L0> l0_expr) const | |
renamedt<ssa_exprt, L2> symex_level2t:: | ||
operator()(renamedt<ssa_exprt, L1> l1_expr) const | ||
{ | ||
if(!l1_expr.get().get_level_2().empty()) | ||
return renamedt<ssa_exprt, L2>{std::move(l1_expr.value)}; | ||
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. This change seems surprising to me, but I'm likely just missing something. Would you mind explaining? 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. As for the symex_level1t case, it does not change the behaviour because it is only called from set_l2_indices which had the same check until this commit. We need the check to be here and not in |
||
l1_expr.value.set_level_2(current_count(l1_expr.get().get_identifier())); | ||
return renamedt<ssa_exprt, L2>{std::move(l1_expr.value)}; | ||
} | ||
|
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.
To make sure there is no change in behaviour this will require an
INVARIANT
that!l0_expr.get().get_level_2().empty()
implies!l0_expr.get().get_level_1().empty()
. And I'm not convinced that holds, because a global variable would not need L1 renaming, even when L2 is non-empty.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.
Yes this does not hold, so we can't add an invariant. The reason this does not change the behaviour is that it is only called from
set_l1_indices
which had the same check until this commit.