diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-24 20:15:27 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-24 20:15:27 +0000 |
| commit | b71251ca71c795ac8ae08c96f84328af6da0c613 (patch) | |
| tree | cb116cc1446d777d720aaaee1194a9cf644b2ddb /llvm/tools/bugpoint/CrashDebugger.cpp | |
| parent | bdc0fe55d12430a3bab9a69716cd12bd922eb1d5 (diff) | |
| download | bcm5719-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.cpp | 2 |
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())) |

