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 {
5494
5494
}
5495
5495
5496
5496
bool getExpressionTooComplex (SmallVectorImpl<Solution> const &solutions) {
5497
+ if (isExpressionAlreadyTooComplex)
5498
+ return true ;
5499
+
5497
5500
size_t solutionMemory = 0 ;
5498
5501
for (auto const & s : solutions) {
5499
5502
solutionMemory += s.getTotalMemory ();
Original file line number Diff line number Diff line change @@ -504,6 +504,11 @@ template <typename P> class BindingStep : public SolverStep {
504
504
505
505
public:
506
506
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
+
507
512
while (auto choice = Producer ()) {
508
513
if (shouldSkip (*choice))
509
514
continue ;
You can’t perform that action at this time.
0 commit comments