Index: tools/bugpoint/Miscompilation.cpp =================================================================== --- tools/bugpoint/Miscompilation.cpp +++ tools/bugpoint/Miscompilation.cpp @@ -327,8 +327,8 @@ AbstractInterpreter *AI = BD.switchToSafeInterpreter(); bool Failure; std::unique_ptr New = - testMergedProgram(BD, std::move(ToOptimizeLoopExtracted), - std::move(ToNotOptimize), Error, Failure); + testMergedProgram(BD, CloneModule(ToOptimizeLoopExtracted.get()), + CloneModule(ToNotOptimize.get()), Error, Failure); if (!New) return false; @@ -760,7 +760,7 @@ std::unique_ptr &Test, Module *Safe) { // Clean up the modules, removing extra cruft that we don't need anymore... - Test = BD.performFinalCleanups(Test.get()); + Test = BD.performFinalCleanups(Test.release()); // If we are executing the JIT, we have several nasty issues to take care of. if (!BD.isExecutingJIT()) return;