Skip to content

Miri misses UB in place expressions when there are "_" patterns #2360

Closed

Description

The following example should both be UB, but Miri finds neither of it: (this got fixed by rust-lang/rust#104844)

fn main() {
    let ptr = 32 as *const u8;
    unsafe { let _ = *ptr; }
}

This is blocked on rust-lang/rust#99180.

Here's another variant: (that is not fixed yet, will be fixed by rust-lang/rust#103208)

fn main() {
    let ptr = 32 as *const u8;
    unsafe {
        match *ptr { _ => {} }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-interpreterArea: affects the core interpreterC-bugCategory: This is a bug.I-misses-UBImpact: makes Miri miss UB, i.e., a false negative (with default settings)S-blockedStatus: blocked on something happening somewhere else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions