Skip to content

Commit 371dbf9

Browse files
committed
rustc: Dispose the intrinsics LLVMModuleRef
1 parent cad8c73 commit 371dbf9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/comp/back/link.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ fn link_intrinsics(session::session sess, ModuleRef llmod) {
4444
fail;
4545
}
4646

47-
if (llvm::LLVMLinkModules(llmod, llintrinsicsmod) == False) {
47+
auto linkres = llvm::LLVMLinkModules(llmod, llintrinsicsmod);
48+
llvm::LLVMDisposeModule(llintrinsicsmod);
49+
50+
if (linkres == False) {
4851
llvm_err(sess, "couldn't link the module with the intrinsics");
4952
fail;
5053
}

0 commit comments

Comments
 (0)