Skip to content

Commit d57a38b

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

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
@@ -3692,6 +3692,10 @@ void constraints::simplifyLocator(ASTNode &anchor,
36923692
case ConstraintLocator::Condition: {
36933693
if (auto *condStmt = getAsStmt<LabeledConditionalStmt>(anchor)) {
36943694
anchor = &condStmt->getCond().front();
3695+
} else if (auto *whileStmt = getAsStmt<RepeatWhileStmt>(anchor)) {
3696+
anchor = whileStmt->getCond();
3697+
} else if (auto *assertStmt = getAsStmt<PoundAssertStmt>(anchor)) {
3698+
anchor = assertStmt->getCondition();
36953699
} else {
36963700
anchor = castToExpr<TernaryExpr>(anchor)->getCondExpr();
36973701
}

0 commit comments

Comments
 (0)