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]fnvec_failure(){let value:u8 = 1;/* set to zero and it passes */let count:u16 = kani::any();let vector:Vec<u8> = vec![value; count asusize];}
In case anyone encounters this... I found that I could get this to pass by mocking out std::intrinsics::write_bytes:
fnmock_write_bytes<T>(dst:*mutT,val:u8,count:usize){}#[kani::proof]#[kani::stub(std::intrinsics::write_bytes, mock_write_bytes)]fnvec_failure(){let value:u8 = 1;/* set to zero and it passes */let count:u16 = kani::any();let vector:Vec<u8> = vec![value;countasusize];}
And then run with:
cargo kani --harness vec_failure -Z stubbing
However, because stubbing requires --harness, this isn't very scalable.
I tried this code:
using the following command line invocation:
with Kani version:
When it is run with
value = 1
, it produces the following failure:But when run with
value = 0
, it succeeds.I expected uniform behavior in both cases, but perhaps the intrinsics special-case zero somehow?
The text was updated successfully, but these errors were encountered: