authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-22 14:50:06+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-22 14:50:06+02:00
log773863150a96fcb9ddb3eccb585d10342d10cb78
tree6fdaa2bf681d9feb97fe3d72643385d2389c081b
parentca90efe88e3b354884a82d341936e5a0724d74c8

macho: fix incorrect prealloc in traditional path


1 files changed, 4 insertions(+), 3 deletions(-)

src/link/MachO.zig+4-3
......@@ -425,7 +425,8 @@ pub fn flush(self: *MachO, comp: *Compilation) !void {
425425 }
426426 }
427427
428 if (build_options.is_stage1) {
428 const use_stage1 = build_options.is_stage1 and self.base.options.use_stage1;
429 if (use_stage1) {
429430 return self.linkWithZld(comp);
430431 } else {
431432 switch (self.base.options.effectiveOutputMode()) {
......@@ -3153,7 +3154,7 @@ fn writeSymbolTable(self: *MachO) !void {
31533154 if (object.debug_info == null) continue;
31543155
31553156 // Open scope
3156 try locals.ensureUnusedCapacity(4);
3157 try locals.ensureUnusedCapacity(3);
31573158 locals.appendAssumeCapacity(.{
31583159 .n_strx = try self.makeString(object.tu_comp_dir.?),
31593160 .n_type = macho.N_SO,
......@@ -3192,7 +3193,7 @@ fn writeSymbolTable(self: *MachO) !void {
31923193 }
31933194
31943195 // Close scope
3195 locals.appendAssumeCapacity(.{
3196 try locals.append(.{
31963197 .n_strx = 0,
31973198 .n_type = macho.N_SO,
31983199 .n_sect = 0,