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
{{ message }}
Repository navigation
-Z valid-value-checks: reading an invalid element through a slice pointer is not reported #5022
Verification fails: the byte read as bool is 2 (Rust Reference, [undefined.validity.bool]).
Actual behavior
** 0 of 7 failed
VERIFICATION:- SUCCESSFUL
Reading the same byte through *(bytes.as_ptr() as *const bool) fails:
Failed Checks: Undefined Behavior: Invalid value of type `bool`
The same happens with slice::from_raw_parts(bytes.as_ptr() as *const bool, 4)[0].
Cause
For a deref of *const [bool], visit_place asks ty_validity_per_offset for the
requirements of [bool]. Its layout is FieldsShape::Array { count: 0 }, which does not match
the count > 0 arm and falls into the "Anything is valid" arm
(kani-compiler/src/kani_middle/transform/check_values.rs:1162-1165). The following Index
projection is treated as safe, so the element read is never checked.
Activity