Dispose the module.

Thanks to brson for noticing it.
上级 106f783b
...@@ -7066,6 +7066,7 @@ fn run_passes(ModuleRef llmod, bool opt, bool verify, str output, ...@@ -7066,6 +7066,7 @@ fn run_passes(ModuleRef llmod, bool opt, bool verify, str output,
_str.buf(x86.get_target_triple()), _str.buf(x86.get_target_triple()),
_str.buf(output), _str.buf(output),
FileType); FileType);
llvm.LLVMDisposeModule(llmod);
ret; ret;
} }
......
...@@ -70,5 +70,6 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, LLVMModuleRef M, ...@@ -70,5 +70,6 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, LLVMModuleRef M,
bool foo = Target.addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify); bool foo = Target.addPassesToEmitFile(*PM, FOS, FileType2, OLvl, NoVerify);
assert(!foo); assert(!foo);
(void)foo;
PM->run(*unwrap(M)); PM->run(*unwrap(M));
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册