]> granicus.if.org Git - clang/commitdiff
One more fix for use of invalid PresumedLocs missed by r267914.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 28 Apr 2016 19:54:51 +0000 (19:54 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 28 Apr 2016 19:54:51 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267926 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/SourceManager.cpp

index c2d9e58c2959285b3412711890bd2c2017832d2f..1e83b63cf82efdf6fe3f7d73b7a947417bd6f6c4 100644 (file)
@@ -1394,8 +1394,9 @@ unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
 }
 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