Open kulkarniniraj opened 5 days ago
0.13.0
const print = @import("std").debug.print; const DirEntry = extern struct { name: [8] u8, ext: [3] u8, }; pub fn main() !void { var data_buffer: [512]u8 align(2)= undefined; const dir_entry_list: []DirEntry = &data_buffer; print("dir entry: {s}", .{dir_entry_list[0].name}); }
zig build-exe scratchpad.zig
fish: Job 1, 'zig build-exe scratchpad.zig' terminated by signal SIGSEGV (Address boundary error)
Program builds or compiler throws some error.
Only observed with align(2) or more. align(1) or removing align throws compiler errors as expected.
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
Build or run
zig build-exe scratchpad.zig
Compiler crashes:
fish: Job 1, 'zig build-exe scratchpad.zig' terminated by signal SIGSEGV (Address boundary error)
Expected Behavior
Program builds or compiler throws some error.