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 fn that checks pointers point to same allocation #3583

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Oct 8, 2024

This changes adds a new function that returns whether two pointers points to the same allocated object. Since we cannot reason about addresses to objects that are dead or haven't been allocated, we panic if the user provides dangling pointers.

Call-out:

  • Creating this as draft for now for early feedback

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@celinval celinval requested a review from a team as a code owner October 8, 2024 23:21
@celinval celinval marked this pull request as draft October 8, 2024 23:21
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Oct 8, 2024
@celinval
Copy link
Contributor Author

celinval commented Oct 8, 2024

@tautschnig @zhassan-aws what do you think about this?

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.

Makes sense!

library/kani_core/src/mem.rs Outdated Show resolved Hide resolved
@celinval celinval marked this pull request as ready for review October 16, 2024 03:13
@celinval
Copy link
Contributor Author

@tautschnig @zhassan-aws ?

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.

Nice tests!

library/kani_core/src/mem.rs Show resolved Hide resolved
@celinval celinval added this pull request to the merge queue Oct 17, 2024
Merged via the queue into model-checking:main with commit 5b03a9f Oct 17, 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.

3 participants