Cross-function union instrumentation#3465
Merged
celinval merged 11 commits intomodel-checking:mainfrom Sep 4, 2024
Merged
Conversation
14 tasks
artemagvanian
commented
Aug 27, 2024
celinval
reviewed
Aug 30, 2024
celinval
reviewed
Aug 30, 2024
Contributor
celinval
left a comment
There was a problem hiding this comment.
Thanks Artem! It's looking good.
kani-compiler/src/kani_middle/transform/check_uninit/ptr_uninit/uninit_visitor.rs
Show resolved
Hide resolved
kani-compiler/src/kani_middle/transform/check_uninit/ptr_uninit/uninit_visitor.rs
Show resolved
Hide resolved
kani-compiler/src/kani_middle/transform/check_uninit/ptr_uninit/uninit_visitor.rs
Show resolved
Hide resolved
kani-compiler/src/kani_middle/transform/check_uninit/relevant_instruction.rs
Outdated
Show resolved
Hide resolved
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.
This PR introduces support for memory initialization checks for unions passed across the function boundary.
Whenever a union is passed as an argument, we need to make sure that its initialization state is preserved. Unlike pointers, unions do not have a stable memory address which could identify them in shadow memory. Hence, we need to pass extra information across function boundary since unions are passed “by value”.
We introduce a global variable to store the previous address of unions passed as function arguments, which allows us to effectively tie the initialization state of unions passed between functions. This struct is written to by the caller and read from by the callee.
For more information about planned functionality, see #3300
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.