| ... | ... | @@ -454,12 +454,12 @@ pub const Object = struct { |
| 454 | 454 | // Until then we iterate over existing aliases and make them point |
| 455 | 455 | // to the correct decl, or otherwise add a new alias. Old aliases are leaked. |
| 456 | 456 | for (exports) |exp| { |
| 457 | | if (self.llvm_module.getNamedGlobalAlias(exp.options.name.ptr, exp.options.name.len)) |alias| { |
| 457 | const exp_name_z = try module.gpa.dupeZ(u8, exp.options.name); |
| 458 | defer module.gpa.free(exp_name_z); |
| 459 | |
| 460 | if (self.llvm_module.getNamedGlobalAlias(exp_name_z.ptr, exp_name_z.len)) |alias| { |
| 458 | 461 | alias.setAliasee(llvm_fn); |
| 459 | 462 | } else { |
| 460 | | const exp_name_z = try module.gpa.dupeZ(u8, exp.options.name); |
| 461 | | defer module.gpa.free(exp_name_z); |
| 462 | | |
| 463 | 463 | const alias = self.llvm_module.addAlias(llvm_fn.typeOf(), llvm_fn, exp_name_z); |
| 464 | 464 | _ = alias; |
| 465 | 465 | } |