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.
This commit is contained in:
Andrew Kelley
2021-12-07 17:03:29 -07:00
parent de81c504b1
commit 83a6681955

View File

@@ -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) });