summaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-25 01:03:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-25 01:03:03 +0000
commit45e1f0e3e7a2030e2e95863cf2bcceb7eb2476ff (patch)
tree30ae2a80e39614536d5578fdcf16b6da94f5720a /lib/Basic/SourceManager.cpp
parent1dd5208a7b86ace1154b6ad31ab73bb725352512 (diff)
downloadclang-45e1f0e3e7a2030e2e95863cf2bcceb7eb2476ff.tar.gz
Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index dfd2a1baf4..0de5129a35 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -2043,7 +2043,7 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
// is a serialized one referring to a file that was removed after we loaded
// the PCH.
if (LOffs.first.isInvalid() || ROffs.first.isInvalid())
- return LOffs.first.isInvalid();
+ return LOffs.first.isInvalid() && !ROffs.first.isInvalid();
// If the source locations are in the same file, just compare offsets.
if (LOffs.first == ROffs.first)