Commit 7c37c55161

Jakub Konka <kubkon@jakubkonka.com>
2024-07-22 17:32:43
macho: fix 32bit compilation issues
1 parent 8541119
Changed files (1)
src
src/link/MachO.zig
@@ -2475,7 +2475,7 @@ fn writeThunkWorker(self: *MachO, thunk: Thunk) void {
     defer tracy.end();
     const doWork = struct {
         fn doWork(th: Thunk, buffer: []u8, macho_file: *MachO) !void {
-            const off = th.value;
+            const off = math.cast(usize, th.value) orelse return error.Overflow;
             const size = th.size();
             var stream = std.io.fixedBufferStream(buffer[off..][0..size]);
             try th.write(macho_file, stream.writer());