| ... | @@ -441,7 +441,7 @@ fn updateFinish(self: *Plan9, decl_index: Module.Decl.Index) !void { | ... | @@ -441,7 +441,7 @@ fn updateFinish(self: *Plan9, decl_index: Module.Decl.Index) !void { |
| 441 | const sym: aout.Sym = .{ | 441 | const sym: aout.Sym = .{ |
| 442 | .value = undefined, // the value of stuff gets filled in in flushModule | 442 | .value = undefined, // the value of stuff gets filled in in flushModule |
| 443 | .type = decl_block.type, | 443 | .type = decl_block.type, |
| 444 | .name = mod.intern_pool.stringToSlice(decl.name), | 444 | .name = try self.base.allocator.dupe(u8, mod.intern_pool.stringToSlice(decl.name)), |
| 445 | }; | 445 | }; |
| 446 | | 446 | |
| 447 | if (decl_block.sym_index) |s| { | 447 | if (decl_block.sym_index) |s| { |
| ... | @@ -741,7 +741,7 @@ fn addDeclExports( | ... | @@ -741,7 +741,7 @@ fn addDeclExports( |
| 741 | const sym = .{ | 741 | const sym = .{ |
| 742 | .value = decl_block.offset.?, | 742 | .value = decl_block.offset.?, |
| 743 | .type = decl_block.type.toGlobal(), | 743 | .type = decl_block.type.toGlobal(), |
| 744 | .name = exp_name, | 744 | .name = try self.base.allocator.dupe(u8, exp_name), |
| 745 | }; | 745 | }; |
| 746 | | 746 | |
| 747 | if (metadata.getExport(self, exp_name)) |i| { | 747 | if (metadata.getExport(self, exp_name)) |i| { |