Skip to content

Commit c3a4434

Browse files
committed
[ConstraintSystem] Integrate emergency break into iterative solver loop
There are situations when solver goes exponential, before (when solver was recursive) it would fail relatively quickly by running out of stack space, now we really need to make sure that emergency break is in place in main solver loop, otherwise we risk it running for a really long time if doesn't consume too much memory since default timeout is ~10 mins.
1 parent f1a53c3 commit c3a4434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSStep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ bool SplitterStep::mergePartialSolutions() const {
249249
StepResult ComponentStep::take(bool prevFailed) {
250250
// One of the previous components created by "split"
251251
// failed, it means that we can't solve this component.
252-
if (prevFailed)
252+
if (prevFailed || CS.getExpressionTooComplex(Solutions))
253253
return done(/*isSuccess=*/false);
254254

255255
if (!IsSingle && CS.TC.getLangOpts().DebugConstraintSolver) {

0 commit comments

Comments
 (0)