| ... | ... | @@ -2070,8 +2070,6 @@ pub fn updateFunc(self: *MachO, module: *Module, func: *Module.Fn, air: Air, liv |
| 2070 | 2070 | self.freeUnnamedConsts(decl_index); |
| 2071 | 2071 | Atom.freeRelocations(self, atom_index); |
| 2072 | 2072 | |
| 2073 | | const atom = self.getAtom(atom_index); |
| 2074 | | |
| 2075 | 2073 | var code_buffer = std.ArrayList(u8).init(self.base.allocator); |
| 2076 | 2074 | defer code_buffer.deinit(); |
| 2077 | 2075 | |
| ... | ... | @@ -2100,7 +2098,13 @@ pub fn updateFunc(self: *MachO, module: *Module, func: *Module.Fn, air: Air, liv |
| 2100 | 2098 | const addr = try self.updateDeclCode(decl_index, code); |
| 2101 | 2099 | |
| 2102 | 2100 | if (decl_state) |*ds| { |
| 2103 | | try self.d_sym.?.dwarf.commitDeclState(module, decl_index, addr, atom.size, ds); |
| 2101 | try self.d_sym.?.dwarf.commitDeclState( |
| 2102 | module, |
| 2103 | decl_index, |
| 2104 | addr, |
| 2105 | self.getAtom(atom_index).size, |
| 2106 | ds, |
| 2107 | ); |
| 2104 | 2108 | } |
| 2105 | 2109 | |
| 2106 | 2110 | // Since we updated the vaddr and the size, each corresponding export symbol also |
| ... | ... | @@ -2196,8 +2200,8 @@ pub fn updateDecl(self: *MachO, module: *Module, decl_index: Module.Decl.Index) |
| 2196 | 2200 | } |
| 2197 | 2201 | |
| 2198 | 2202 | const atom_index = try self.getOrCreateAtomForDecl(decl_index); |
| 2203 | const sym_index = self.getAtom(atom_index).getSymbolIndex().?; |
| 2199 | 2204 | Atom.freeRelocations(self, atom_index); |
| 2200 | | const atom = self.getAtom(atom_index); |
| 2201 | 2205 | |
| 2202 | 2206 | var code_buffer = std.ArrayList(u8).init(self.base.allocator); |
| 2203 | 2207 | defer code_buffer.deinit(); |
| ... | ... | @@ -2216,14 +2220,14 @@ pub fn updateDecl(self: *MachO, module: *Module, decl_index: Module.Decl.Index) |
| 2216 | 2220 | }, &code_buffer, .{ |
| 2217 | 2221 | .dwarf = ds, |
| 2218 | 2222 | }, .{ |
| 2219 | | .parent_atom_index = atom.getSymbolIndex().?, |
| 2223 | .parent_atom_index = sym_index, |
| 2220 | 2224 | }) |
| 2221 | 2225 | else |
| 2222 | 2226 | try codegen.generateSymbol(&self.base, decl.srcLoc(), .{ |
| 2223 | 2227 | .ty = decl.ty, |
| 2224 | 2228 | .val = decl_val, |
| 2225 | 2229 | }, &code_buffer, .none, .{ |
| 2226 | | .parent_atom_index = atom.getSymbolIndex().?, |
| 2230 | .parent_atom_index = sym_index, |
| 2227 | 2231 | }); |
| 2228 | 2232 | |
| 2229 | 2233 | var code = switch (res) { |
| ... | ... | @@ -2237,7 +2241,13 @@ pub fn updateDecl(self: *MachO, module: *Module, decl_index: Module.Decl.Index) |
| 2237 | 2241 | const addr = try self.updateDeclCode(decl_index, code); |
| 2238 | 2242 | |
| 2239 | 2243 | if (decl_state) |*ds| { |
| 2240 | | try self.d_sym.?.dwarf.commitDeclState(module, decl_index, addr, atom.size, ds); |
| 2244 | try self.d_sym.?.dwarf.commitDeclState( |
| 2245 | module, |
| 2246 | decl_index, |
| 2247 | addr, |
| 2248 | self.getAtom(atom_index).size, |
| 2249 | ds, |
| 2250 | ); |
| 2241 | 2251 | } |
| 2242 | 2252 | |
| 2243 | 2253 | // Since we updated the vaddr and the size, each corresponding export symbol also |