zig
zig copied to clipboard
segfault `bitCast`ing arrays of comptime only types
Zig Version
0.12.0-dev.3419+a2651cbc8
Steps to Reproduce and Observed Behavior
test {
_ = @as([1]u32, @bitCast([_]comptime_int{0}));
}
this segfaults the compiler, it seems like any comptime only type causes this not just comptime_int
Expected Behavior
compile error
happens because we run bitSize on the array, but never rule out a comptime_int array. Same thing should happen if [1]comptime_int as the destination size.