Skip to content

Commit fafb362

Browse files
committed
Sema: Fix latent bug due to unhandled cases in constraints::simplifyLocator()
1 parent 884c501 commit fafb362

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,6 +3731,10 @@ void constraints::simplifyLocator(ASTNode &anchor,
37313731
case ConstraintLocator::Condition: {
37323732
if (auto *condStmt = getAsStmt<LabeledConditionalStmt>(anchor)) {
37333733
anchor = &condStmt->getCond().front();
3734+
} else if (auto *whileStmt = getAsStmt<RepeatWhileStmt>(anchor)) {
3735+
anchor = whileStmt->getCond();
3736+
} else if (auto *assertStmt = getAsStmt<PoundAssertStmt>(anchor)) {
3737+
anchor = assertStmt->getCondition();
37343738
} else {
37353739
anchor = castToExpr<TernaryExpr>(anchor)->getCondExpr();
37363740
}

0 commit comments

Comments
 (0)