File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -829,9 +829,14 @@ static bool isBeforeInSource(
829
829
auto [firstMismatch, secondMismatch] = std::mismatch (
830
830
firstAncestors.begin (), firstAncestors.end (),
831
831
secondAncestors.begin (), secondAncestors.end ());
832
- assert (firstMismatch != firstAncestors.begin () &&
833
- secondMismatch != secondAncestors.begin () &&
834
- " Ancestors don't have the same root source file" );
832
+ if (firstMismatch == firstAncestors.begin () ||
833
+ secondMismatch == secondAncestors.begin ()) {
834
+ // FIXME: This is currently being hit for code completion
835
+ // (rdar://134522702), possibly due to an invalid ASTScope node range. For
836
+ // now, let's bail with `false` in non-asserts builds.
837
+ assert (false && " Ancestors don't have the same root source file" );
838
+ return false ;
839
+ }
835
840
836
841
SourceLoc firstLocInLCA = firstMismatch == firstAncestors.end ()
837
842
? firstLoc
You can’t perform that action at this time.
0 commit comments