-
Notifications
You must be signed in to change notification settings - Fork 274
Validity checking of void
pointers in contracts
#6375
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
7f7744a
to
7c8b893
Compare
if(opt_size_of_deref.has_value()) | ||
validity_checks.push_back(good_pointer_def(pointer, ns)); | ||
else | ||
validity_checks.push_back(false_exprt()); |
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.
Could you add a comment here this could happen in case of void pointers?
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.
Looks good. Thanks.
Codecov Report
@@ Coverage Diff @@
## develop #6375 +/- ##
========================================
Coverage 75.91% 75.91%
========================================
Files 1517 1517
Lines 164024 164026 +2
========================================
+ Hits 124515 124517 +2
Misses 39509 39509
Continue to review full report at Codecov.
|
Closing this PR after offline discussions. We would want to raise an error in this case and not ignore it as invalid. |
It would be neat if we could retain the change you made do src/util/pointer_predicates.cpp in whatever comes next. |
PR #6365 introduced
good_pointer_def
checks on all pointers being deref'ed within code contracts. However, this function crashes onvoid
pointers.In this PR, we consider deref'ing
void
pointers as "invalid" as opposed to crashing.The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/My commit message includes data points confirming performance improvements (if claimed).White-space or formatting changes outside the feature-related changed lines are in commits of their own.