Skip to content
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

LLVM assert with boxed classes and destructors #2708

Closed
brson opened this issue Jun 22, 2012 · 3 comments
Closed

LLVM assert with boxed classes and destructors #2708

brson opened this issue Jun 22, 2012 · 3 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Jun 22, 2012

type cairo_scaled_font_t = uint;

class Font/& {
    let fontbuf: [u8];
    let cairo_font: *cairo_scaled_font_t;
    let font_dtor: fn@();

    new(-fontbuf: [u8]) {

        self.fontbuf <- fontbuf;
        self.cairo_font = ptr::null();
        self.font_dtor = fn@() { };
    }

    drop {
        self.font_dtor();
    }
}

class FontLibrary {
    let bogus: int;

    new() { self.bogus = 0; }

    fn get_font() -> @Font {
        let f = Font([]);
        ret @f;
    }
}

fn main() { }
rustc: /home/banderson/Dev/rust2/src/llvm/include/llvm/Instructions.h:703: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed.
@brson
Copy link
Contributor Author

brson commented Jun 22, 2012

Reduced:

class Font {
    let fontbuf: uint;
    let cairo_font: uint;
    let font_dtor: uint;

    new() {
        self.fontbuf = 0;
        self.cairo_font = 0;
        self.font_dtor = 0;
    }

    drop { }
}

fn main() {
    let _f = @Font();
}

Adding fields doesn't fix the problem. Reducing fields does.

@ghost ghost assigned catamorphism Jun 22, 2012
@catamorphism
Copy link
Contributor

This is fixed, just waiting for a snapshot.

@brson
Copy link
Contributor Author

brson commented Jun 25, 2012

Nice! Thanks, tjc.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 3, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Benchcomp CI is now broken due to rust-lang#2704. The clean up we are performing is a best effort at this point, but it shouldn't fail the regression if it doesn't work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

2 participants