-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rust: Various fixes to the CFG construction #17800
Conversation
Previously the math was wrong and the first argument (with `i` being `0`) had two edges out of it.
According to the DCA results this PR seems to fix the vast majority of CFG inconsistencies. There's a few still left in some projects. I'll take a look at those as well and update the PR. |
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, only one minor thing. Thanks a lot for structuring the PR into easy reviewable commits.
@@ -612,6 +612,8 @@ module PatternTrees { | |||
result = rank[i + 1](Pat pat, int j | pat = this.getPat(j) | pat order by j) | |||
} | |||
|
|||
predicate isEmpty() { not any(Pat p) = this.getPat(0) } |
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.
not exists(this.getPat(_))
.
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.
True. I realized that that was a bug, fixed in a later commit and after 6568eb8 it got removed as the behavior is now inherited from StandardTree
.
I've updated the PR to fix the CI and add one more inconsistency fix ( |
This PR fixes a bunch of inconsistencies in the CFG construction. This should reduce the number of CFG inconsistencies we see on real projects quite a bit.
Most of these are simple fixes and come with test cases and separate commits, so I won't describe them in detail. Please ask or comment if there's anything that's not clear.