Skip to content

Conversation

xsxszab
Copy link
Collaborator

@xsxszab xsxszab commented Oct 23, 2024

Modifications

  • Rewrite function contracts using the same_allocation api.
  • Merged macros for add(), sub() and offset().

Known Issue
Currently all verification for unit types will fail because same_allocation does not support object with zero size.

kani::assume(offset <= 1);

let test_ptr: *mut $type = &mut test_val;
let ptr_with_offset: *mut $type = test_ptr.wrapping_add(offset);
Copy link
Owner

Choose a reason for hiding this comment

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

do you think we can use wrapping_byte_add to create and test unaligned pointers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just tested it out, actually unaligned pointer worked fine, I think we can use wrapping_byte_add in our next version

@xsxszab xsxszab merged commit 6385d4a into verify/ptr_mut Nov 7, 2024
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.

2 participants