Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!
llvm-svn: 105329
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 2c51180..aebb7e1 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -2953,8 +2953,9 @@
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