Skip to content

Assertion 'Ty && "Invalid GetElementPtrInst for type!"' failed #11552

Closed
@martindevans

Description

@martindevans

When compiling this program (cut down as much as possible to isolate the failure) with rust-0.9:

#[deriving(Clone)]
enum Noun
{
    Atom(int),
    Cell(~Noun, ~Noun)
}

fn fas(n: &Noun) -> Noun
{
    match n
    {
        &Cell(~Atom(2), ~Cell(ref a, _)) => (**a).clone(),
        _ => fail!("Invalid fas pattern")
    }
}

fn main() {
    fas(&Cell(~Atom(1), ~Atom(2)));
}

I get the following failure:

rustc: /home/martin/rust-0.9/src/llvm/include/llvm/IR/Instructions.h:702: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed.
Aborted (core dumped)

Metadata

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.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions