Skip to content

LLVM assert with boxed classes and destructors #2708

Closed
@brson

Description

@brson
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions