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

Add method to assert a pointer is valid #3062

Merged
merged 6 commits into from
Mar 13, 2024

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Mar 6, 2024

This new method will assert that a pointer isn't null, and that its is valid for access of a given type.

I'm creating this as a draft for now as I'm still adding more tests.

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 Mar 6, 2024
@celinval celinval marked this pull request as ready for review March 7, 2024 23:51
@celinval celinval requested a review from a team as a code owner March 7, 2024 23:51
Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @celinval!

Can we add at least one expected test so that we can match against the descriptions of the new pointer checks (Dangling pointer, non-null pointer, valid pointer, etc.).

kani-compiler/src/codegen_cprover_gotoc/overrides/hooks.rs Outdated Show resolved Hide resolved
library/kani/src/mem.rs Outdated Show resolved Hide resolved
library/kani/src/mem.rs Outdated Show resolved Hide resolved
library/kani/src/mem.rs Outdated Show resolved Hide resolved
library/kani/src/mem.rs Outdated Show resolved Hide resolved
library/kani/src/mem.rs Show resolved Hide resolved
celinval and others added 2 commits March 8, 2024 11:34
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

Approving as this is a temporary solution per the discussions.

@celinval
Copy link
Contributor Author

celinval commented Mar 9, 2024

Approving as this is a temporary solution per the discussions.

Would you like me to document that this signature is temporary? The method is marked as unstable too.

@zhassan-aws
Copy link
Contributor

The method is marked as unstable too.

This should be sufficient. Thanks.

@celinval celinval enabled auto-merge (squash) March 11, 2024 04:06
@celinval celinval merged commit fb6300d into model-checking:main Mar 13, 2024
20 checks passed
@celinval celinval self-assigned this Mar 19, 2024
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.

None yet

2 participants