From 6d3bc0898ee4b0aaaf81db4f94a14490954de0e7 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 2 Jun 2010 15:47:10 +0000 Subject: Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric! llvm-svn: 105329 --- clang/lib/Frontend/PCHReader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib') 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 -- cgit v1.2.3