Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2).

llvm-svn: 182698
This commit is contained in:
Argyrios Kyrtzidis 2013-05-25 01:03:03 +00:00
parent e24b872188
commit d6111d3c6d
1 changed files with 1 additions and 1 deletions

View File

@ -2043,7 +2043,7 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
// is a serialized one referring to a file that was removed after we loaded // is a serialized one referring to a file that was removed after we loaded
// the PCH. // the PCH.
if (LOffs.first.isInvalid() || ROffs.first.isInvalid()) 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 the source locations are in the same file, just compare offsets.
if (LOffs.first == ROffs.first) if (LOffs.first == ROffs.first)