diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-28 19:54:51 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-28 19:54:51 +0000 |
| commit | 75ca7db314d34a14750f18cc35e018f667571f86 (patch) | |
| tree | ca9600af1b5b9dd9edb8a3c9c3793c65aeb0b89f /lib/Basic/SourceManager.cpp | |
| parent | fdbc47bf66cbe8eff3f278acd92a54b700b401bd (diff) | |
One more fix for use of invalid PresumedLocs missed by r267914.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
| -rw-r--r-- | lib/Basic/SourceManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index c2d9e58c29..1e83b63cf8 100644 --- a/lib/Basic/SourceManager.cpp +++ b/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 |
