Commit 83a6681955

Andrew Kelley <andrew@ziglang.org>
2021-12-08 01:03:29
link: fix build for 32-bit targets
This wasn't caught by the CI checks because this function is is only called for the `use_stage1` codepath.
1 parent de81c50
Changed files (1)
src
src/link/MachO.zig
@@ -1985,7 +1985,7 @@ fn writeAllAtoms(self: *MachO) !void {
 
         var buffer = std.ArrayList(u8).init(self.base.allocator);
         defer buffer.deinit();
-        try buffer.ensureTotalCapacity(sect.size);
+        try buffer.ensureTotalCapacity(try math.cast(usize, sect.size));
 
         log.debug("writing atoms in {s},{s}", .{ commands.segmentName(sect), commands.sectionName(sect) });