| ... | @@ -1170,7 +1170,8 @@ fn linkOneShot(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) | ... | @@ -1170,7 +1170,8 @@ fn linkOneShot(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) |
| 1170 | physical_zerofill_start = header.offset + header.size; | 1170 | physical_zerofill_start = header.offset + header.size; |
| 1171 | } else break :blk; | 1171 | } else break :blk; |
| 1172 | const linkedit = self.segments.items[self.linkedit_segment_cmd_index.?]; | 1172 | const linkedit = self.segments.items[self.linkedit_segment_cmd_index.?]; |
| 1173 | const physical_zerofill_size = linkedit.fileoff - physical_zerofill_start; | 1173 | const physical_zerofill_size = math.cast(usize, linkedit.fileoff - physical_zerofill_start) orelse |
| | 1174 | return error.Overflow; |
| 1174 | if (physical_zerofill_size > 0) { | 1175 | if (physical_zerofill_size > 0) { |
| 1175 | var padding = try self.base.allocator.alloc(u8, physical_zerofill_size); | 1176 | var padding = try self.base.allocator.alloc(u8, physical_zerofill_size); |
| 1176 | defer self.base.allocator.free(padding); | 1177 | defer self.base.allocator.free(padding); |