-
Notifications
You must be signed in to change notification settings - Fork 274
CONTRACTS: detect and handle locals in assigns clause checking for loops #6947
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: detect and handle locals in assigns clause checking for loops #6947
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6947 +/- ##
===========================================
+ Coverage 77.79% 77.83% +0.03%
===========================================
Files 1568 1569 +1
Lines 180347 180350 +3
===========================================
+ Hits 140309 140370 +61
+ Misses 40038 39980 -58
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.
Thanks, Remi. Makes sense to me overall.
A few small comments on missing documentation / minor code changes etc.
#include <vector> | ||
|
||
/// Stores information about a goto function computed from its CFG, | ||
/// together with a `target` iterator into the instructions of the function. |
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.
The iterator has been removed, comment cleanup needed
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 (considering all existing comments).
// For goto_functions | ||
class function_cfg_infot : public cfg_infot |
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.
nitpick: why not add the implementation of these functions on a separate .c
file?
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.
There's only three methods and two concrete classes, it seemed like overkill
591ed94
to
ddd32b4
Compare
When no assigns clause was provided, we were trying to infer variables touched by the loop and generate an assigns clause from that. Some of these variables could be locals, which have no meaning outside the loop, and we were trying to snapshot these variables outside of the loop. We now detect loop locals and remove them from the inferred frame condition the loop.
ddd32b4
to
00959cc
Compare
all changes made |
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; thanks Remi!
Fixes #6943.
When no assigns clause was provided, we were trying to infer variables touched by the loop and generate an assigns clause from that. Some of these variables could be locals, which have no meaning outside the loop, and we were trying to snapshot these variables outside of the loop. We now detect loop locals and remove them from the inferred frame condition the loop.