From 371dbf9834b04aec0041d1b397eeb320220d652a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 14 May 2011 00:15:53 -0400 Subject: [PATCH] rustc: Dispose the intrinsics LLVMModuleRef --- src/comp/back/link.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs index 830264d35e0..258073f1d4e 100644 --- a/src/comp/back/link.rs +++ b/src/comp/back/link.rs @@ -44,7 +44,10 @@ fn link_intrinsics(session::session sess, ModuleRef llmod) { fail; } - if (llvm::LLVMLinkModules(llmod, llintrinsicsmod) == False) { + auto linkres = llvm::LLVMLinkModules(llmod, llintrinsicsmod); + llvm::LLVMDisposeModule(llintrinsicsmod); + + if (linkres == False) { llvm_err(sess, "couldn't link the module with the intrinsics"); fail; }