From 9b5b1905dbad19de374e7617f615ba522ffe0468 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Feb 2005 06:12:11 +0000 Subject: Fix a bugpoint crash that JeffC noticed, looking like this: *** Attempting to perform final cleanups: Final cleanups failed. Sorry. :( Ple ase report a bug! llc.exe: bytecode didn't read correctly. llc.exe: bytecode didn't read correctly. Assertion failed: M && "You can't write a null module!!", file c:\llvm\lib\bytec ode\writer\writer.cpp, line 1094 The fact that llc bombed (in this case) is ok, but bugpoint shouldn't crash after this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20285 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ExtractFunction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/bugpoint') diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index 078c7baf4e..0eecc49efd 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -98,7 +98,7 @@ static const PassInfo *getPI(Pass *P) { /// performFinalCleanups - This method clones the current Program and performs /// a series of cleanups intended to get rid of extra cruft on the module -/// before handing it to the user... +/// before handing it to the user. /// Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) { // Make all functions external, so GlobalDCE doesn't delete them... @@ -118,6 +118,7 @@ Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) { Module *New = runPassesOn(M, CleanupPasses); if (New == 0) { std::cerr << "Final cleanups failed. Sorry. :( Please report a bug!\n"; + return M; } delete M; return New; -- cgit v1.2.3