With the merge of #3856, calling a function with a new stack regressed a bit:
export fn entry() void {
var buf: [10]u8 align(16) = undefined;
@call(.{.stack = &buf}, foo, .{});
}
fn foo() void {}
Used to be OK, now gives:
/home/andy/dev/zig/build/test.zig:3:5: error: unable to evaluate constant expression
@call(.{ .stack = &buf }, foo, .{});
^
Need more Runtime Hint Propagation to make this work. However this is a low priority because it's not clear this feature is going to make it into zig.
Above example works if you make the memory global:
var buf: [10]u8 align(16) = undefined;
export fn entry() void {
@call(.{.stack = &buf}, foo, .{});
}
fn foo() void {}
I hate this bug. @call is a great feature, but now it's broken.
Most helpful comment
I hate this bug.
@callis a great feature, but now it's broken.