From 891c1cf1f41599611dc3fa125d333c62db0f4df9 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Tue, 26 May 2015 15:24:18 +0300 Subject: [PATCH] Fix for the bug, which crashed ispc during file write (showed up on MacOS and Windows with LLVM trunk). --- module.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module.cpp b/module.cpp index 98716888..104831c6 100644 --- a/module.cpp +++ b/module.cpp @@ -1486,6 +1486,7 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, pm.add(dlp); #endif // LLVM 3.7+ doesn't have DataLayoutPass anymore. + { #if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6) llvm::formatted_raw_ostream fos(of->os()); #else // LLVM 3.7+ @@ -1501,6 +1502,9 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, // Success; tell tool_output_file to keep the final output file. of->keep(); + } + + delete of; return true; }