-
Notifications
You must be signed in to change notification settings - Fork 273
Check for validity of pointers in assigns clause #6077
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
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.
I few minor comments.
c325804
to
84a5186
Compare
84a5186
to
ff218b6
Compare
7e05751
to
a9712e2
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.
LGTM
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.
Mostly LGTM, but I left a few minor comments.
Also, please check why the builds are failing.
a9712e2
to
94d2e03
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6077 +/- ##
===========================================
+ Coverage 74.52% 75.12% +0.59%
===========================================
Files 1447 1447
Lines 157808 157825 +17
===========================================
+ Hits 117610 118563 +953
+ Misses 40198 39262 -936
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.
Almost there. A couple of previous comments that are unaddressed:
This adds support for the cases where a null pointer is passed as a parameter to a function that may assign to it. We add checks in goto program to handle such instances as special cases of assigns clause handling.
94d2e03
to
d5402d9
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.
LGTM. Thanks for all the changes! 😄
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
Consider the following example:
The potential problem in this case is that
foo
callsbar
by passing a null pointer. Of course, considering the contents ofbar
, this will not be problematic. However, the assigns clause forbar
is not aware of what is insidebar
, so the assigns clause previously could not handle the null pointer.This PR adds support for such cases, by checking for passed null pointers at the goto program level.
Note: currently, this PR only supports pointers, which is required for function contracts for the coreJSON project.