aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-28 19:54:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-28 19:54:51 +0000
commit9c52767f362457d0cbd76292988a9a103d7f35bf (patch)
tree4bfa315519501d7e4e08845038a0467790b92f32 /clang/lib/Basic/SourceManager.cpp
parente5fcce2d2b0a9ff048bc8f6aa0bb776a18a671c2 (diff)
downloadllvm-9c52767f362457d0cbd76292988a9a103d7f35bf.zip
llvm-9c52767f362457d0cbd76292988a9a103d7f35bf.tar.gz
llvm-9c52767f362457d0cbd76292988a9a103d7f35bf.tar.bz2
One more fix for use of invalid PresumedLocs missed by r267914.
llvm-svn: 267926
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index c2d9e58..1e83b63 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -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