Repository navigation
verify: Compare a callee footprint with the caller's frame by its cells - #52
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A call failed its
framecheck, with a counterexample, even when the callee wrote only cells the caller may write. This happened in 0.1.1 and onmain:Cause
footprintWithin(Passivize.cpp) decides whether a callee footprint lies in a caller footprint. It has two gaps:false, even thoughcalleeFootprintBytesalready computes a region of one scalar object as one cell.samePointerRegion:a == q). A callee footprint reached through a copy of a pointer into the region's object therefore never fit.A store already follows the semantic rule. In the function's own frame check, a store through any pointer is inside a region footprint when its address lies in the region parameter's entry object.
Fix
The call check now follows the same rule as stores:
A footprint with the same base as the caller's region produces exactly the query it did before. A call that failed before can now verify only when its cells provably lie in the caller's frame. The test's false twins check this:
aby the precondition;bside is outside the frame;modifiesrange is wider than its extent, froma + 3;This is also the frame half of B3a-2. Passing
&r->headtosetundermodifies(r->head)needs this check.Tests
suite/frame_call_objects.cppcontains:framecheck at the call, withc = falsefor the choice.On
mainevery function in the file except the callees fails.Docs
Checked
On
mainat de4972d:Verify lit suite: 429 passed and 1 unsupported, on both the release build and an assertions build. This includes the docs tests.
VerifyTests: 60 passed, 1 skipped.
On
main:frame_call_objects.cppfails.Verdict differential against
main: 437 test sources. Only the new test differs, and no file's time changed (3544 s → 3501 s in total).Mutation: 6 mutants, all killed by the test. They:
Two cases were added for mutants that first survived: the copy placed above
a, and the wide callee. A redundant emptiness disjunct was removed, since an empty callee range is already accepted before this check.Docs:
check-doc-examples.pypasses on every page this changes (56 examples, 10 against the verdicts their pages show).Merges: this merges cleanly with each open PR, verify: Follow the body of a choose in a spec's reads and postcondition checks #43, verify: Make chooses with one condition one choice, kept across writes elsewhere #44, verify: Send crash reports to cpp-verify's issue tracker #46, verify: Bound what a run builds and what its solvers allocate #48, and docs: Publish the documentation of each release, and of main at /dev/ #49.