Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
martindevans opened this issue Jan 15, 2014 · 1 comment · Fixed by #12641
Closed

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

martindevans opened this issue Jan 15, 2014 · 1 comment · Fixed by #12641
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@martindevans
Copy link

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)
@luqmana
Copy link
Member

luqmana commented Mar 1, 2014

Cannot reproduce as of rustc 0.10-pre (58ea029 2014-02-28 10:51:34 -0800). Marking as needstest.

bors added a commit that referenced this issue Mar 1, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 25, 2023
… r=y21

prevent ice when threshold is 0 and enum has no variants

changelog: [`enum_variant_names`]: prevent ice when threshold is 0 and enum has no variants

r? `@y21`

Fixes the same ice issue raised during review of rust-lang/rust-clippy#11496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants