From b71251ca71c795ac8ae08c96f84328af6da0c613 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 24 Apr 2018 20:15:27 +0000 Subject: [bugpoint] Fix crash when testing for miscompilation. Method BugDriver::performFinalCleanups(...) would delete Module object it worked on, which was also deleted by its caller (e.g. TestCodeGenerator(...)). Changed the code to avoid double delete and make Module ownership slightly clearer. Patch by Andrzej Janik. llvm-svn: 330763 --- llvm/tools/bugpoint/CrashDebugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp') diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 3b7f2af436c..631784a2c65 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -1161,7 +1161,7 @@ static Error DebugACrash(BugDriver &BD, BugTester TestFn) { if (!BugpointIsInterrupted) { outs() << "\n*** Attempting to perform final cleanups: "; std::unique_ptr M = CloneModule(BD.getProgram()); - M = BD.performFinalCleanups(M.release(), true); + M = BD.performFinalCleanups(std::move(M), true); // Find out if the pass still crashes on the cleaned up program... if (M && TestFn(BD, M.get())) -- cgit v1.2.3