-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)Area: This affects the aliasing model (Stacked/Tree Borrows)A-interpreterArea: affects the core interpreterArea: affects the core interpreterC-bugCategory: This is a bug.Category: This is a bug.I-false-UBImpact: makes Miri falsely report UB, i.e., a false positive (with default settings)Impact: makes Miri falsely report UB, i.e., a false positive (with default settings)
Description
The following program should pass, but is incorrectly considered UB:
#![feature(raw_ref_op)]
fn main() {
#[repr(packed)]
struct S {
fill: u8,
a: i32,
b: i64,
}
let mut x = S {
fill: 0,
a: 42,
b: 99,
};
assert_eq!(unsafe { (&raw const x.a).read_unaligned() }, 42);
assert_eq!(unsafe { (&raw const x.b).read_unaligned() }, 99);
}
The error source seems to be related to Stacked Borrows.
Metadata
Metadata
Assignees
Labels
A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)Area: This affects the aliasing model (Stacked/Tree Borrows)A-interpreterArea: affects the core interpreterArea: affects the core interpreterC-bugCategory: This is a bug.Category: This is a bug.I-false-UBImpact: makes Miri falsely report UB, i.e., a false positive (with default settings)Impact: makes Miri falsely report UB, i.e., a false positive (with default settings)