Skip to content

Commit

Permalink
Fix for the bug, which crashed ispc during file write (showed up on
Browse files Browse the repository at this point in the history
MacOS and Windows with LLVM trunk).
  • Loading branch information
dbabokin committed May 26, 2015
1 parent c251194 commit 891c1cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module.cpp
Expand Up @@ -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+
Expand All @@ -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;
}
Expand Down

0 comments on commit 891c1cf

Please sign in to comment.