| ... | @@ -2311,7 +2311,7 @@ fn createDsoHandleAtom(self: *MachO) !void { | ... | @@ -2311,7 +2311,7 @@ fn createDsoHandleAtom(self: *MachO) !void { |
| 2311 | nlist.n_desc = macho.N_WEAK_DEF; | 2311 | nlist.n_desc = macho.N_WEAK_DEF; |
| 2312 | try self.globals.append(self.base.allocator, nlist); | 2312 | try self.globals.append(self.base.allocator, nlist); |
| 2313 | | 2313 | |
| 2314 | _ = self.unresolved.fetchSwapRemove(resolv.where_index); | 2314 | assert(self.unresolved.swapRemove(resolv.where_index)); |
| 2315 | | 2315 | |
| 2316 | undef.* = .{ | 2316 | undef.* = .{ |
| 2317 | .n_strx = 0, | 2317 | .n_strx = 0, |
| ... | @@ -2409,7 +2409,7 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { | ... | @@ -2409,7 +2409,7 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { |
| 2409 | const global = &self.globals.items[resolv.where_index]; | 2409 | const global = &self.globals.items[resolv.where_index]; |
| 2410 | | 2410 | |
| 2411 | if (symbolIsTentative(global.*)) { | 2411 | if (symbolIsTentative(global.*)) { |
| 2412 | _ = self.tentatives.fetchSwapRemove(resolv.where_index); | 2412 | assert(self.tentatives.swapRemove(resolv.where_index)); |
| 2413 | } else if (!(symbolIsWeakDef(sym) or symbolIsPext(sym)) and | 2413 | } else if (!(symbolIsWeakDef(sym) or symbolIsPext(sym)) and |
| 2414 | !(symbolIsWeakDef(global.*) or symbolIsPext(global.*))) | 2414 | !(symbolIsWeakDef(global.*) or symbolIsPext(global.*))) |
| 2415 | { | 2415 | { |
| ... | @@ -2437,7 +2437,7 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { | ... | @@ -2437,7 +2437,7 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { |
| 2437 | .n_desc = 0, | 2437 | .n_desc = 0, |
| 2438 | .n_value = 0, | 2438 | .n_value = 0, |
| 2439 | }; | 2439 | }; |
| 2440 | _ = self.unresolved.fetchSwapRemove(resolv.where_index); | 2440 | assert(self.unresolved.swapRemove(resolv.where_index)); |
| 2441 | }, | 2441 | }, |
| 2442 | } | 2442 | } |
| 2443 | | 2443 | |
| ... | @@ -2496,6 +2496,8 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { | ... | @@ -2496,6 +2496,8 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { |
| 2496 | .n_value = sym.n_value, | 2496 | .n_value = sym.n_value, |
| 2497 | }); | 2497 | }); |
| 2498 | _ = try self.tentatives.getOrPut(self.base.allocator, global_sym_index); | 2498 | _ = try self.tentatives.getOrPut(self.base.allocator, global_sym_index); |
| | 2499 | assert(self.unresolved.swapRemove(resolv.where_index)); |
| | 2500 | |
| 2499 | resolv.* = .{ | 2501 | resolv.* = .{ |
| 2500 | .where = .global, | 2502 | .where = .global, |
| 2501 | .where_index = global_sym_index, | 2503 | .where_index = global_sym_index, |
| ... | @@ -2508,7 +2510,6 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { | ... | @@ -2508,7 +2510,6 @@ fn resolveSymbolsInObject(self: *MachO, object_id: u16) !void { |
| 2508 | .n_desc = 0, | 2510 | .n_desc = 0, |
| 2509 | .n_value = 0, | 2511 | .n_value = 0, |
| 2510 | }; | 2512 | }; |
| 2511 | _ = self.unresolved.fetchSwapRemove(resolv.where_index); | | |
| 2512 | }, | 2513 | }, |
| 2513 | } | 2514 | } |
| 2514 | } else { | 2515 | } else { |
| ... | @@ -3412,7 +3413,7 @@ pub fn updateDeclExports( | ... | @@ -3412,7 +3413,7 @@ pub fn updateDeclExports( |
| 3412 | const sym = &self.globals.items[resolv.where_index]; | 3413 | const sym = &self.globals.items[resolv.where_index]; |
| 3413 | | 3414 | |
| 3414 | if (symbolIsTentative(sym.*)) { | 3415 | if (symbolIsTentative(sym.*)) { |
| 3415 | _ = self.tentatives.fetchSwapRemove(resolv.where_index); | 3416 | assert(self.tentatives.swapRemove(resolv.where_index)); |
| 3416 | } else if (!is_weak and !(symbolIsWeakDef(sym.*) or symbolIsPext(sym.*))) { | 3417 | } else if (!is_weak and !(symbolIsWeakDef(sym.*) or symbolIsPext(sym.*))) { |
| 3417 | _ = try module.failed_exports.put( | 3418 | _ = try module.failed_exports.put( |
| 3418 | module.gpa, | 3419 | module.gpa, |
| ... | @@ -3438,7 +3439,7 @@ pub fn updateDeclExports( | ... | @@ -3438,7 +3439,7 @@ pub fn updateDeclExports( |
| 3438 | continue; | 3439 | continue; |
| 3439 | }, | 3440 | }, |
| 3440 | .undef => { | 3441 | .undef => { |
| 3441 | _ = self.unresolved.fetchSwapRemove(resolv.where_index); | 3442 | assert(self.unresolved.swapRemove(resolv.where_index)); |
| 3442 | _ = self.symbol_resolver.remove(n_strx); | 3443 | _ = self.symbol_resolver.remove(n_strx); |
| 3443 | }, | 3444 | }, |
| 3444 | } | 3445 | } |