Skip to content
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

Cross-function union instrumentation #3465

Merged
merged 11 commits into from
Sep 4, 2024

Conversation

artemagvanian
Copy link
Contributor

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.

@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Aug 27, 2024
@artemagvanian artemagvanian marked this pull request as ready for review August 28, 2024 23:06
@artemagvanian artemagvanian requested a review from a team as a code owner August 28, 2024 23:06
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Artem! It's looking good.

Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @artemagvanian!

library/kani_core/src/mem_init.rs Show resolved Hide resolved
library/kani_core/src/mem_init.rs Outdated Show resolved Hide resolved
@celinval celinval added this pull request to the merge queue Sep 4, 2024
Merged via the queue into model-checking:main with commit 93a29af Sep 4, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants