-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.14.1
Steps to Reproduce and Observed Behavior
Minimal Reproduction Code:
const std = @import("std");
var counter: usize = 0;
inline fn tail_call(
comptime Target: type,
) std.mem.Allocator.Error!void {
// Arbitrary condition for tailing
if (counter >= 1024) return;
counter += 1;
@setEvalBranchQuota(10_000);
try @call(.always_tail, tail_call, .{
Target,
});
}
pub fn main() !void {
try tail_call(f32);
}Simply building under any mode: Debug, Release* causes this behavior, e.g. zig build-exe test.zig
This results in segmentation fault.
Expected Behavior
Expected an error message stating that tail calling an inline function is illegal, which does happen without the comptime parameter: error: inline call is recursive
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior