-
Notifications
You must be signed in to change notification settings - Fork 140
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
Fix resource loss analysis and definite initialization analysis #1332
Conversation
- only consider definite invalidations - fix tracking when break or continue statements occur
Codecov Report
@@ Coverage Diff @@
## master #1332 +/- ##
==========================================
+ Coverage 75.57% 75.59% +0.02%
==========================================
Files 279 279
Lines 37813 37837 +24
==========================================
+ Hits 28578 28604 +26
+ Misses 7958 7957 -1
+ Partials 1277 1276 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 834f5f1 Results
|
|
||
assert.IsType(t, &sema.ResourceLossError{}, errs[0]) | ||
assert.IsType(t, &sema.UnreachableStatementError{}, errs[1]) | ||
assert.IsType(t, &sema.ResourceLossError{}, errs[2]) |
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.
Is this a potential duplicate error?
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, there is now an additional error reported, but "over reporting" isn't a problem: The first resource loss error is reported by the resource loss check by the return statement, and the second is returned by the resource loss check at the end of the function. Both are correct and I don't think it is worth the effort to reduce over reporting
|
||
assert.IsType(t, &sema.ResourceLossError{}, errs[0]) | ||
assert.IsType(t, &sema.UnreachableStatementError{}, errs[1]) | ||
assert.IsType(t, &sema.ResourceLossError{}, errs[2]) |
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.
same here?
Co-authored-by: Supun Setunga <[email protected]>
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.
Nice! LGTM! 👌
Closes #1325
Based heavily on #1329, thank you @SupunS 🙏
Investigating the issue I also discovered that the definite initialization analysis suffered from the same problem.
Description
master
branchFiles changed
in the Github PR explorer