-
Notifications
You must be signed in to change notification settings - Fork 277
havoc call return value when replacing a call by its contract #6502
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
havoc call return value when replacing a call by its contract #6502
Conversation
af08b3f
to
cbc1f68
Compare
…act. This was not done previously and could result in vacuous proofs when multiple calls to a same function were replaced in a same scope.
cbc1f68
to
320a9f8
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6502 +/- ##
========================================
Coverage 76.08% 76.08%
========================================
Files 1548 1548
Lines 166387 166399 +12
========================================
+ Hits 126591 126603 +12
Misses 39796 39796
Continue to review full report at Codecov.
|
@@ -0,0 +1,23 @@ | |||
int cmp(int i1, int i2) |
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.
Random place for comment: can you please add "Fixes: #6483" to the commit message so that the issue is auto-resolved once this PR is merged?
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'll go ahead and merge anyway, so this is just for future reference.
@@ -23,6 +23,7 @@ Date: February 2016 | |||
#include <goto-instrument/havoc_utils.h> | |||
|
|||
#include <goto-programs/goto_inline.h> | |||
#include <goto-programs/goto_program.h> |
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 don't think this is strictly necessary? (Even the remove_skip.h
will already drag in this header.)
This PR adds havoc instructions for the return value of function call when it gets replaced by the function's contract.
This havocking was missing previously and could result in vacuous instances when a same function was replaced more than once in a same scope (e.g. in loops), and the same return value variable was subjected to a superposition of post-conditions that can be contradicting each other.