-
Notifications
You must be signed in to change notification settings - Fork 390
Open
Labels
A-interpreterArea: affects the core interpreterArea: affects the core interpreterC-bugCategory: This is a bug.Category: This is a bug.I-misses-UBImpact: makes Miri miss UB, i.e., a false negative (with default settings)Impact: makes Miri miss UB, i.e., a false negative (with default settings)
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_place
in match MIR lowering are potential places where we mess things up. E.g. here, we want to add aPlaceMention
to the scrutinee which we can't do if it's not captured, could that have weird consequences maybe?
Metadata
Metadata
Assignees
Labels
A-interpreterArea: affects the core interpreterArea: affects the core interpreterC-bugCategory: This is a bug.Category: This is a bug.I-misses-UBImpact: makes Miri miss UB, i.e., a false negative (with default settings)Impact: makes Miri miss UB, i.e., a false negative (with default settings)