-
Notifications
You must be signed in to change notification settings - Fork 274
CONTRACTS: look for dirty symbols in OTHER
instructions.
#7085
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
CONTRACTS: look for dirty symbols in OTHER
instructions.
#7085
Conversation
Traverse `OTHER` instructions subexpressions when the `statement` is `ID_array_*` or `ID_havoc_object`.
Codecov Report
@@ Coverage Diff @@
## develop #7085 +/- ##
========================================
Coverage 77.85% 77.85%
========================================
Files 1574 1574
Lines 181235 181245 +10
========================================
+ Hits 141099 141109 +10
Misses 40136 40136
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
void collect_other(const goto_functiont &goto_function) | ||
{ | ||
for(const auto &i : goto_function.body.instructions) | ||
{ | ||
if(i.is_other()) | ||
{ | ||
auto &statement = i.get_other().get_statement(); | ||
if( | ||
statement == ID_array_set || statement == ID_array_copy || | ||
statement == ID_array_replace || statement == ID_array_equal || | ||
statement == ID_havoc_object) | ||
{ | ||
for(const auto &op : i.get_other().operands()) | ||
{ | ||
find_dirty(op); | ||
} | ||
} | ||
} | ||
} | ||
} |
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.
LGTM, but why not incorporate this change into dirtyt
class itself?
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.
Modifying dirtyt
could have wide-ranging repercussions since many other analyses depend on it.
Traverse
OTHER
instructions subexpressions when thestatement
isID_array_*
orID_havoc_object
, whichdirtyt
does not do and is needed for assigns clause checking when array operations are involved.Array ops are not supported in the current contract implementation so there is no impact on tests or performance.
This feature will be used in the upcoming dynamic frame condition checking PR.