[llvm] r292532 - LTO: Flush the resolution file after writing to it.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 15:10:14 PST 2017


Author: pcc
Date: Thu Jan 19 17:10:14 2017
New Revision: 292532

URL: http://llvm.org/viewvc/llvm-project?rev=292532&view=rev
Log:
LTO: Flush the resolution file after writing to it.

Without this the file could be truncated if the linker crashes.

Modified:
    llvm/trunk/lib/LTO/LTO.cpp

Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=292532&r1=292531&r2=292532&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Thu Jan 19 17:10:14 2017
@@ -372,6 +372,7 @@ static void writeToResolutionFile(raw_os
       OS << 'x';
     OS << '\n';
   }
+  OS.flush();
   assert(ResI == Res.end());
 }
 




More information about the llvm-commits mailing list