Skip to content

RUST_CC_ZEAL crash with box closure #1989

@jruderman

Description

@jruderman
enum maybe_pointy {
    none,
    p(@pointy)
}

type pointy = {
    mut a : maybe_pointy,
    mut f : fn@()->(),
};

fn empty_pointy() -> @pointy {
    ret @{
        mut a : none,
        mut f : fn@()->(){},
    }
}

fn main()
{
    let v : [mut @pointy] = [mut];

    uint::range(0u, 2u) {|_i|
        v += [mut empty_pointy()];
    }

    v[0].a = p(v[0]);
}

Gives me a crash or

Assertion failed: (box->ref_count >= 1), function box_body_td, file ../src/rt/rust_shape.h, line 703.

Once this is fixed I'll run my CC mini-fuzzer again ;)

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions