-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Labels
A-mirArea: this is about the MIR that we are executing, not about how we are executing itArea: this is about the MIR that we are executing, not about how we are executing itC-bugCategory: This is a bug.Category: This is a bug.I-misses-theoretical-UBImpact: Miri does not report UB when it should, but codegen also "misses" this UBImpact: Miri does not report UB when it should, but codegen also "misses" this UB
Description
use std::mem::transmute;
fn main() {
let r: &&u32 = unsafe {
let x = 42;
transmute(&&x)
};
// no UB detected
let f = || { let _ = **r; };
f();
// UB due to the inner deref
let _ = **r;
}Found this when prompted by @Nadrieril:
In fact the other calls to
{try_}to_placein match MIR lowering are potential places where we mess things up. E.g. here, we want to add aPlaceMentionto the scrutinee which we can't do if it's not captured, could that have weird consequences maybe?
Metadata
Metadata
Assignees
Labels
A-mirArea: this is about the MIR that we are executing, not about how we are executing itArea: this is about the MIR that we are executing, not about how we are executing itC-bugCategory: This is a bug.Category: This is a bug.I-misses-theoretical-UBImpact: Miri does not report UB when it should, but codegen also "misses" this UBImpact: Miri does not report UB when it should, but codegen also "misses" this UB