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

AWS Team 3: Verifying <*const T>::offset #92

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

stogaru
Copy link

@stogaru stogaru commented Sep 20, 2024

Changes made:

  • Adds the function contracts and proof for the const offset function.

Problems :

  • What should be the valid input range for the count argument as asked here? How will we know the start address and the length of the allocated object from a raw pointer?

Works toward resolving #76

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

@stogaru stogaru requested a review from a team as a code owner September 20, 2024 23:45
@@ -388,6 +400,10 @@ impl<T: ?Sized> *const T {
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[requires(kani::mem::can_dereference(self))]
// TODO: Determine the valid value range for 'count' and update the precondition accordingly.
#[requires(count == 0)] // This precondition is currently a placeholder.
Copy link
Author

Choose a reason for hiding this comment

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

This precondition needs to be changed based on the valid input range agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants