Skip to content

Commit

Permalink
macho: make sure we do not ensure too much capacity in -r mode for re…
Browse files Browse the repository at this point in the history
…locs
  • Loading branch information
kubkon committed May 19, 2024
1 parent d26c60d commit 4b891bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MachO/relocatable.zig
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn writeAtoms(macho_file: *MachO) !void {
const padding_byte: u8 = if (header.isCode() and cpu_arch == .x86_64) 0xcc else 0;
@memset(code, padding_byte);

try relocs.ensureUnusedCapacity(header.nreloc);
try relocs.ensureTotalCapacity(header.nreloc);

for (atoms.items) |atom_index| {
const atom = macho_file.getAtom(atom_index).?;
Expand Down

0 comments on commit 4b891bb

Please sign in to comment.