Fix a buggy conversion from bytecode to bitcode
[oota-llvm.git] / tools / bugpoint / OptimizerDriver.cpp
index 5f031dc14ce479f6681f8dd71f37f0794cb440ee..047901fd9f6d587aa0cc10bba97517b2bc07b4ff 100644 (file)
@@ -57,7 +57,7 @@ bool BugDriver::writeProgramToFile(const std::string &Filename,
   std::ofstream Out(Filename.c_str(), io_mode);
   if (!Out.good()) return true;
   
-  WriteBitcodeToFile(M, Out);
+  WriteBitcodeToFile(M ? M : Program, Out);
   return false;
 }