Skip to content

ICE when linking two extern functions to the same function, but with different signatures #5791

Closed

Description

extern {
    #[link_name = "malloc"]
    fn malloc1(len: libc::c_int) -> *libc::c_void;
    #[link_name = "malloc"]
    fn malloc2(len: libc::c_int, foo: libc::c_int) -> *libc::c_void;
}

fn main () { }
rustc: /build/src/rust-0.6/src/llvm/include/llvm/Support/Casting.h:197: typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X = llvm::Function; Y = llvm::Value*; typename llvm::cast_retty<To, From>::ret_type = llvm::Function*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
zsh: abort (core dumped)  rustc test3.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions