Skip to content

Commit c424f51

Browse files
authored
Merge pull request #8284 from rudkx/assert-on-failed-constraint
2 parents e3bc23c + aab3de7 commit c424f51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ ConstraintSystem::SolverScope::SolverScope(ConstraintSystem &cs)
462462
PreviousScore = cs.CurrentScore;
463463

464464
cs.solverState->registerScope(this);
465+
assert(!cs.failedConstraint && "Unexpected failed constraint!");
466+
465467
++cs.solverState->NumStatesExplored;
466468
}
467469

@@ -1986,7 +1988,7 @@ bool ConstraintSystem::solve(SmallVectorImpl<Solution> &solutions,
19861988
// Simplify any constraints left active after constraint generation
19871989
// and optimization. Return if the resulting system has no
19881990
// solutions.
1989-
if (simplify())
1991+
if (failedConstraint || simplify())
19901992
return true;
19911993

19921994
// If the experimental constraint propagation pass is enabled, run it.

0 commit comments

Comments
 (0)