summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/CrashDebugger.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-04-24 20:15:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-04-24 20:15:27 +0000
commitb71251ca71c795ac8ae08c96f84328af6da0c613 (patch)
treecb116cc1446d777d720aaaee1194a9cf644b2ddb /llvm/tools/bugpoint/CrashDebugger.cpp
parentbdc0fe55d12430a3bab9a69716cd12bd922eb1d5 (diff)
downloadbcm5719-llvm-b71251ca71c795ac8ae08c96f84328af6da0c613.tar.gz
bcm5719-llvm-b71251ca71c795ac8ae08c96f84328af6da0c613.zip
[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
Diffstat (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp2
1 files changed, 1 insertions, 1 deletions
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<Module> 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()))
OpenPOWER on IntegriCloud