-
Notifications
You must be signed in to change notification settings - Fork 273
Bugfix rewrite_with_to_field_symbols #4832
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
Bugfix rewrite_with_to_field_symbols #4832
Conversation
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: a1f2f32).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/116615574
src/goto-symex/symex_assign.cpp
Outdated
|
||
if(field_sensitive_lhs.id() != ID_symbol) | ||
break; | ||
state.field_sensitivity.apply(ns, state, field_sensitive_lhs, true); |
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.
apply
gains an argument in the wrong (first) commit
src/goto-symex/symex_assign.cpp
Outdated
@@ -450,7 +455,12 @@ void goto_symext::symex_assign_symbol( | |||
// in the future these should be omitted. | |||
auto assignment = shift_indexed_access_to_lhs( | |||
state, assignmentt{lhs, std::move(l2_rhs)}, ns, symex_config.simplify_opt); | |||
assignment = rewrite_with_to_field_symbols(state, std::move(assignment), ns); | |||
assignment = | |||
#ifdef USE_UPDATE |
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.
Introduce an auxiliary function like inline bool use_update() { #ifdef USE_UPDATE return true; #else return false; #endif }
?
src/goto-symex/symex_assign.cpp
Outdated
while(assignment.rhs.id() == ID_with && | ||
to_with_expr(assignment.rhs).operands().size() == 3 && | ||
(lhs_mod.type().id() == ID_array || | ||
lhs_mod.type().id() == ID_struct || |
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.
Reformat in wrong commit
src/goto-symex/symex_assign.cpp
Outdated
@@ -250,7 +250,8 @@ static assignmentt rewrite_with_to_field_symbols( | |||
update.new_value().type()); | |||
} | |||
|
|||
state.field_sensitivity.apply(ns, state, field_sensitive_lhs, true); | |||
field_sensitive_lhs = state.field_sensitivity.apply( |
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.
!!! Test for this fix? Also mention in the commit message that this is actually a bugfix (or fix it in a separate commit?)
a1f2f32
to
538b735
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4832 +/- ##
========================================
Coverage 69.67% 69.67%
========================================
Files 1248 1248
Lines 100836 100836
========================================
Hits 70262 70262
Misses 30574 30574
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 538b735).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/116647352
5cb2fd6
to
2282957
Compare
I've extracted the ifdef/template refactoring to a new PR #4840, in order to only keep here the bugfix and add unit test to it. |
2282957
to
62fdd80
Compare
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 62fdd80).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/128747800
@romainbrenguier Would you mind rebasing so that this change can be merged? |
Not using the result is certainly a bug, so we mark it as NODISCARD.
62fdd80
to
28d6848
Compare
done |
This fix the case where USE_UPDATE is not defined, and replace the ifdef by a template argument, so that it could be tested for both cases.