-
Notifications
You must be signed in to change notification settings - Fork 277
Check subset relationship of assigns clause during replacement #6345
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
Check subset relationship of assigns clause during replacement #6345
Conversation
289c957
to
cd5fef0
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6345 +/- ##
========================================
Coverage 75.90% 75.90%
========================================
Files 1515 1515
Lines 163990 164005 +15
========================================
+ Hits 124469 124484 +15
Misses 39521 39521
Continue to review full report at Codecov.
|
Signed-off-by: Felipe R. Monteiro <[email protected]>
cd5fef0
to
5e8852b
Compare
Signed-off-by: Felipe R. Monteiro <[email protected]>
Signed-off-by: Felipe R. Monteiro <[email protected]>
5e8852b
to
b623a0b
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.
LTGM! Thanks 😄
Not a blocker, but I think we could make helper functions for generating containment and subset assertions. We have repeated code blocks for generating those
@@ -7,7 +7,7 @@ main.c | |||
\[postcondition.\d+\] file main.c line \d+ Check ensures clause: SUCCESS | |||
\[bar.\d+\] line \d+ Check that z is assignable: SUCCESS | |||
\[foo.\d+\] line \d+ Check that \*x is assignable: SUCCESS | |||
\[foo.\d+\] line \d+ Check that callee's assigns clause is a subset of caller's: SUCCESS | |||
\[foo.\d+\] line \d+ Check that bar\'s assigns clause is a subset of foo\'s assigns clause: SUCCESS |
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! 🎉
@@ -272,6 +272,7 @@ void ansi_c_convert_typet::read_rec(const typet &type) | |||
for(auto &assignment : to_unary_expr(as_expr).op().operands()) | |||
assigns.add_to_operands(std::move(assignment)); | |||
} | |||
assigns.add_source_location() = as_expr.source_location(); |
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! 🎉
Signed-off-by: Felipe R. Monteiro <[email protected]>
If CBMC replaces a function
bar()
with its contract, while enforcing the contract in functionfoo()
, it must also check whether thebar()
's assigns clause is a subset of thefoo()
's assigns clause.