r267926 - One more fix for use of invalid PresumedLocs missed by r267914.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 28 12:54:51 PDT 2016


Author: rsmith
Date: Thu Apr 28 14:54:51 2016
New Revision: 267926

URL: http://llvm.org/viewvc/llvm-project?rev=267926&view=rev
Log:
One more fix for use of invalid PresumedLocs missed by r267914.

Modified:
    cfe/trunk/lib/Basic/SourceManager.cpp

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=267926&r1=267925&r2=267926&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Thu Apr 28 14:54:51 2016
@@ -1394,8 +1394,9 @@ unsigned SourceManager::getExpansionLine
 }
 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
                                               bool *Invalid) const {
-  if (isInvalid(Loc, Invalid)) return 0;
-  return getPresumedLoc(Loc).getLine();
+  PresumedLoc PLoc = getPresumedLoc(Loc);
+  if (isInvalid(PLoc, Invalid)) return 0;
+  return PLoc.getLine();
 }
 
 /// getFileCharacteristic - return the file characteristic of the specified




More information about the cfe-commits mailing list