File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -829,9 +829,14 @@ static bool isBeforeInSource(
829829 auto [firstMismatch, secondMismatch] = std::mismatch (
830830 firstAncestors.begin (), firstAncestors.end (),
831831 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+ }
835840
836841 SourceLoc firstLocInLCA = firstMismatch == firstAncestors.end ()
837842 ? firstLoc
You can’t perform that action at this time.
0 commit comments