From 6990c800856fa1b5ed7e4bf100a4e0fab4bdaed5 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 7 Feb 2017 17:44:35 +0100 Subject: [PATCH] delay hole creation in IsDiffCst and IsEqualCst --- src/constraint_solver/expr_cst.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/constraint_solver/expr_cst.cc b/src/constraint_solver/expr_cst.cc index d92a6fc914..3929d6e2d7 100644 --- a/src/constraint_solver/expr_cst.cc +++ b/src/constraint_solver/expr_cst.cc @@ -419,11 +419,14 @@ class IsEqualCstCt : public CastConstraint { int64 l = inhibit ? u : 0; target_var_->SetRange(l, u); if (target_var_->Bound()) { - inhibit = true; if (target_var_->Min() == 0) { - var_->RemoveValue(cst_); + if (var_->Size() <= 0xFFFFFF) { + var_->RemoveValue(cst_); + inhibit = true; + } } else { var_->SetValue(cst_); + inhibit = true; } } if (inhibit) { @@ -534,11 +537,14 @@ class IsDiffCstCt : public CastConstraint { int64 u = inhibit ? l : 1; target_var_->SetRange(l, u); if (target_var_->Bound()) { - inhibit = true; if (target_var_->Min() == 1) { - var_->RemoveValue(cst_); + if (var_->Size() <= 0xFFFFFF) { + var_->RemoveValue(cst_); + inhibit = true; + } } else { var_->SetValue(cst_); + inhibit = true; } } if (inhibit) {