[cfe-commits] r105329 - /cfe/trunk/lib/Frontend/PCHReader.cpp

Daniel Dunbar daniel at zuster.org
Wed Jun 2 08:47:10 PDT 2010


Author: ddunbar
Date: Wed Jun  2 10:47:10 2010
New Revision: 105329

URL: http://llvm.org/viewvc/llvm-project?rev=105329&view=rev
Log:
Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!

Modified:
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=105329&r1=105328&r2=105329&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Jun  2 10:47:10 2010
@@ -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





More information about the cfe-commits mailing list