Skip to content

Function call ABI check ignores ZSTs #4993

@theemathas

Description

@theemathas

The following code has no UB according to Miri. This seems rather suspect.

use std::mem::transmute;

extern "C" fn foo(_: (), _: i32) {}

fn main() {
    let f = unsafe { transmute::<extern "C" fn((), i32), extern "C" fn(i32)>(foo) };
    f(0);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-interpreterArea: affects the core interpreterC-bugCategory: This is a bug.I-misses-theoretical-UBImpact: Miri does not report UB when it should, but codegen also "misses" this UB

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions