diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-05-01 02:45:39 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-05-01 02:45:39 +0000 |
commit | 95109d2eb6f3670e8558868429f2a622b05e7d4f (patch) | |
tree | 337f72de3dd4b7bd511f5d6ab441a5b57cd5945c /lib/ARCMigrate | |
parent | 3a8ac07956ac63bd202cdd3b9e4a2c6cefa888da (diff) |
Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.
Review by Doug Gregor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate')
-rw-r--r-- | lib/ARCMigrate/FileRemapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ARCMigrate/FileRemapper.cpp b/lib/ARCMigrate/FileRemapper.cpp index 474ce7dcba..e9b49b3039 100644 --- a/lib/ARCMigrate/FileRemapper.cpp +++ b/lib/ARCMigrate/FileRemapper.cpp @@ -77,7 +77,9 @@ bool FileRemapper::initFromFile(StringRef filePath, DiagnosticsEngine &Diag, 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); |