]> git.lizzy.rs Git - rust.git/commitdiff
Use LLVMDisposePassManager instead of raw delete in rustllvm
authoryuyoyuppe <a.yuyoyuppe@gmail.com>
Mon, 25 Nov 2019 20:44:26 +0000 (23:44 +0300)
committeryuyoyuppe <a.yuyoyuppe@gmail.com>
Mon, 25 Nov 2019 20:52:10 +0000 (23:52 +0300)
src/rustllvm/PassWrapper.cpp

index 3451346869df9fb8f2b7b590c4f7324368c52035..3e53856a85d017c50c74e22e2a70fb39e16ee704 100644 (file)
@@ -537,7 +537,7 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
   // Apparently `addPassesToEmitFile` adds a pointer to our on-the-stack output
   // stream (OS), so the only real safe place to delete this is here? Don't we
   // wish this was written in Rust?
-  delete PM;
+  LLVMDisposePassManager(PMR);
   return LLVMRustResult::Success;
 }