or at least it looks like it in the stacktrace?
pub const Writer = struct {
out: std.ArrayList(u8),
a: std.mem.Allocator,
pub fn write_u32(self:*@This(), v: u32) void {
var new = self.out.addManyAsSlice(self.a, 4) catch unreachable;
new[0] = @truncate(v);
new[1] = @truncate(v >> 8);
new[2] = @truncate(v >> 16);
new[3] = @truncate(v >> 24);
}
};
Error:
thread 19740 panic: integer overflow
0.16.0\lib\std\heap\ArenaAllocator.zig:357:33: 0x7ff7e4634854 in alloc (CffEditor_zcu.obj)
const alignable = n + alignment.toByteUnits() - 1;
^
0.16.0\lib\std\mem\Allocator.zig:142: 0x7ff7e3d0a193 in rawAlloc (CffEditor_zcu.obj)
return a.vtable.alloc(a.ptr, len, alignment, ret_addr);0.16.0\lib\std\mem\Allocator.zig:142: 0x7ff7e3d0a193 in rawAlloc (CffEditor_zcu.obj)
return a.vtable.alloc(a.ptr, len, alignment, ret_addr);
...0.16.0\lib\std\mem\Allocator.zig:300:35: 0x7ff7e3d0a193 in allocBytesWithAlignment__anon_13643 (CffEditor_zcu.obj)
const byte_ptr = self.rawAlloc(byte_count, alignment, return_address) orelse return error.OutOfMemory;
^
0.16.0\lib\std\mem\Allocator.zig:286:40: 0x7ff7e3d09e71 in allocWithSizeAndAlignment__anon_13633 (CffEditor_zcu.obj)
return self.allocBytesWithAlignment(alignment, byte_count, return_address);
^
0.16.0\lib\std\mem\Allocator.zig:274: 0x7ff7e3d7fe9a in allocAdvancedWithRetAddr (CffEditor_zcu.obj)
const ptr: [*]align(a.toByteUnits()) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address));0.16.0\lib\std\mem\Allocator.zig:274: 0x7ff7e3d7fe9a in allocAdvancedWithRetAddr (CffEditor_zcu.obj)
const ptr: [*]align(a.toByteUnits()) T = @ptrCast(try self.allocWithSizeAndAlignment(@sizeOf(T), a, n, return_address));
...