Skip to content

Commit 9eb1479

Browse files
committed
Dispose the module.
Thanks to brson for noticing it.
1 parent 106f783 commit 9eb1479

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7066,6 +7066,7 @@ fn run_passes(ModuleRef llmod, bool opt, bool verify, str output,
70667066
_str.buf(x86.get_target_triple()),
70677067
_str.buf(output),
70687068
FileType);
7069+
llvm.LLVMDisposeModule(llmod);
70697070
ret;
70707071
}
70717072

src/rustllvm/RustWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, LLVMModuleRef M,
7070

7171
bool foo = Target.addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify);
7272
assert(!foo);
73+
(void)foo;
7374
PM->run(*unwrap(M));
7475
}

0 commit comments

Comments
 (0)