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

Verify/ptr mut refactor harness #12

Merged
merged 6 commits into from
Nov 7, 2024

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