File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -5494,6 +5494,9 @@ class ConstraintSystem {
54945494 }
54955495
54965496 bool getExpressionTooComplex (SmallVectorImpl<Solution> const &solutions) {
5497+ if (isExpressionAlreadyTooComplex)
5498+ return true ;
5499+
54975500 size_t solutionMemory = 0 ;
54985501 for (auto const & s : solutions) {
54995502 solutionMemory += s.getTotalMemory ();
Original file line number Diff line number Diff line change @@ -504,6 +504,11 @@ template <typename P> class BindingStep : public SolverStep {
504504
505505public:
506506 StepResult take (bool prevFailed) override {
507+ // Before attempting the next choice, let's check whether the constraint
508+ // system is too complex already.
509+ if (CS.getExpressionTooComplex (Solutions))
510+ return done (/* isSuccess=*/ false );
511+
507512 while (auto choice = Producer ()) {
508513 if (shouldSkip (*choice))
509514 continue ;
You can’t perform that action at this time.
0 commit comments