| ... | @@ -454,12 +454,12 @@ pub const Object = struct { | ... | @@ -454,12 +454,12 @@ pub const Object = struct { |
| 454 | // Until then we iterate over existing aliases and make them point | 454 | // Until then we iterate over existing aliases and make them point |
| 455 | // to the correct decl, or otherwise add a new alias. Old aliases are leaked. | 455 | // to the correct decl, or otherwise add a new alias. Old aliases are leaked. |
| 456 | for (exports) |exp| { | 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 | alias.setAliasee(llvm_fn); | 461 | alias.setAliasee(llvm_fn); |
| 459 | } else { | 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 | const alias = self.llvm_module.addAlias(llvm_fn.typeOf(), llvm_fn, exp_name_z); | 463 | const alias = self.llvm_module.addAlias(llvm_fn.typeOf(), llvm_fn, exp_name_z); |
| 464 | _ = alias; | 464 | _ = alias; |
| 465 | } | 465 | } |