[cfe-commits] r155880 - /cfe/trunk/lib/ARCMigrate/FileRemapper.cpp

David Blaikie dblaikie at gmail.com
Mon Apr 30 19:45:39 PDT 2012


Author: dblaikie
Date: Mon Apr 30 21:45:39 2012
New Revision: 155880

URL: http://llvm.org/viewvc/llvm-project?rev=155880&view=rev
Log:
Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.

Review by Doug Gregor.

Modified:
    cfe/trunk/lib/ARCMigrate/FileRemapper.cpp

Modified: cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/FileRemapper.cpp?rev=155880&r1=155879&r2=155880&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/FileRemapper.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/FileRemapper.cpp Mon Apr 30 21:45:39 2012
@@ -77,7 +77,9 @@
   for (unsigned idx = 0; idx+3 <= lines.size(); idx += 3) {
     StringRef fromFilename = lines[idx];
     unsigned long long timeModified;
-    lines[idx+1].getAsInteger(10, timeModified);
+    if (lines[idx+1].getAsInteger(10, timeModified))
+      return report("Invalid file data: '" + lines[idx+1] + "' not a number",
+                    Diag);
     StringRef toFilename = lines[idx+2];
     
     const FileEntry *origFE = FileMgr->getFile(fromFilename);





More information about the cfe-commits mailing list