summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-02 15:47:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-02 15:47:10 +0000
commit6d3bc0898ee4b0aaaf81db4f94a14490954de0e7 (patch)
tree3d75cbea628fbb6d12d2a3a2ff6a184b4e3d6685 /clang/lib
parent6906b04457cb7b1d0619de475759861b7727d0ba (diff)
downloadbcm5719-llvm-6d3bc0898ee4b0aaaf81db4f94a14490954de0e7.tar.gz
bcm5719-llvm-6d3bc0898ee4b0aaaf81db4f94a14490954de0e7.zip
Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!
llvm-svn: 105329
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 2c51180afc9..aebb7e17727 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud