generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 134
Closed
Labels
Z-UnstableFeatureIssues that only occur if a unstable feature is enabledIssues that only occur if a unstable feature is enabled[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] SoundnessKani failed to detect an issueKani failed to detect an issue
Description
I tried this code:
#[kani::proof]
fn transmute_surrogate_ub() {
unsafe {
let val: u32 = kani::any();
kani::assume(val < char::MAX.into());
let c: char = std::mem::transmute::<u32, char>(val) as char;
match val {
0..0xD800 | 0xE000..0x110000 => assert!(char::from_u32(val).is_some()),
_ => unreachable!(),
}
}
}using the following command line invocation:
kani -Zvalid-value-checks char.rs
with Kani version: 0.52.0
I expected to see this happen: A valid value check failure
Instead, this happened: An unreachable block being reached due to UB
Failed Checks: internal error: entered unreachable code:
File: "char.rs", line 31, in transmute_surrogate_ub
VERIFICATION:- FAILED
Verification Time: 0.12348909s
Metadata
Metadata
Assignees
Labels
Z-UnstableFeatureIssues that only occur if a unstable feature is enabledIssues that only occur if a unstable feature is enabled[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] SoundnessKani failed to detect an issueKani failed to detect an issue