Sema: Fix latent bug due to unhandled cases in constraints::simplifyLocator()

This commit is contained in:
Slava Pestov
2025-12-05 14:15:01 -05:00
parent bf760aa3dd
commit d57a38be0a

View File

@@ -3692,6 +3692,10 @@ void constraints::simplifyLocator(ASTNode &anchor,
case ConstraintLocator::Condition: {
if (auto *condStmt = getAsStmt<LabeledConditionalStmt>(anchor)) {
anchor = &condStmt->getCond().front();
} else if (auto *whileStmt = getAsStmt<RepeatWhileStmt>(anchor)) {
anchor = whileStmt->getCond();
} else if (auto *assertStmt = getAsStmt<PoundAssertStmt>(anchor)) {
anchor = assertStmt->getCondition();
} else {
anchor = castToExpr<TernaryExpr>(anchor)->getCondExpr();
}