-
Notifications
You must be signed in to change notification settings - Fork 98
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 UB checks for ptr_offset_from* intrinsics #3757
base: main
Are you sure you want to change the base?
Conversation
Still need to adjust tests
Add a new model for `ptr_offset_from` and `ptr_offset_from_unsigned` intrinsics that check allocation and address order.
Moved the ZST check above the check for the same pointer, since the function panics for all ZST pointers
I did some digging into the failing perf tests. The problem seems to be that these models don't properly handle iteration over vectors of vectors, e.g. #[kani::proof]
#[kani::unwind(5)]
#[kani::solver(minisat)]
fn main() {
let v1: Vec<Vec<i32>> = vec![vec![1], vec![2]];
v1.into_iter();
} This code fails with:
|
and adjust test to use byte_offset_from
I'm investigating this issue. It seems that the failure occurs inside |
My bad... I confused size and alignment. Only the second is a power of two. 😊 |
Add a new model for
ptr_offset_from
andptr_offset_from_unsigned
intrinsics that check allocation and address order.
Resolves #3756
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.