diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-02 15:47:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-02 15:47:10 +0000 |
commit | 8ee59398df0e6df2e32109d078235a33b005840c (patch) | |
tree | 3bcd1787e30560f700466288cff2f42ae8fd31ed /lib/Frontend/PCHReader.cpp | |
parent | c0012d65f8a63b0ad0cd5053780322c44a65af3f (diff) |
Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 2c51180afc..aebb7e1772 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -2953,8 +2953,9 @@ PCHReader::ReadNestedNameSpecifier(const RecordData &Record, unsigned &Idx) { SourceRange PCHReader::ReadSourceRange(const RecordData &Record, unsigned &Idx) { - return SourceRange(SourceLocation::getFromRawEncoding(Record[Idx++]), - SourceLocation::getFromRawEncoding(Record[Idx++])); + SourceLocation beg = SourceLocation::getFromRawEncoding(Record[Idx++]); + SourceLocation end = SourceLocation::getFromRawEncoding(Record[Idx++]); + return SourceRange(beg, end); } /// \brief Read an integral value |