You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[kani::proof]fncheck_out_of_bounds(){letmut bytes = kani::slice::any_slice::<u8,5>();let val = unsafe{*bytes.get_slice().as_ptr().add(4)};
kani::assume(val != 0);assert_ne!(val,0);}
using the following command line invocation:
kani check.rs
I expected to see this happen: I expected that accessing position 4 of any_slice may fail with out of bounds access.
Instead, this happened: The verification succeeded. Because any_slice always allocates a buffer with size MAX_SIZE (in this case 5), the access to position 4 is always valid.
Activity
adpaco commentedon Apr 4, 2022
Isn't this another case of uninitialized memory?
Just to be clear, why do you assume
val != 0?celinval commentedon Apr 7, 2022
I was just using the variable. Nothing relevant to the issue itself.
Deprecate any_slice (#2789)