Closed
Description
fn f() { }
const fs: &[extern fn()] = &[f, f];
fn main() { for fs.each |&g| { g() } }
The type_of
(and sizing_type_of
) for that extern fn
is just a pointer, but what's getting generated for the constant also has an environment pointer. Because we have to defeat LLVM's type checks to support enums (and we don't have sufficient assertions of our own), we don't catch the mismatch and the second call to f
jumps through the first array element's null environment pointer instead.
Metadata
Metadata
Assignees
Labels
No labels