From d276ed52f4da78f1d439a06b43bfcb659e3afc69 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 2 Jun 2017 11:07:29 +1000 Subject: [PATCH] Fix typo in bounds checking "x - y". --- lang/check/bounds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/check/bounds.go b/lang/check/bounds.go index fe0683b2..64cea473 100644 --- a/lang/check/bounds.go +++ b/lang/check/bounds.go @@ -503,7 +503,7 @@ func (q *checker) bcheckExprBinaryOp(lhs *a.Expr, op t.Key, rhs *a.Expr, depth u case t.KeyXBinaryPlus: return big.NewInt(0).Add(lMin, rMin), big.NewInt(0).Add(lMax, rMax), nil case t.KeyXBinaryMinus: - return big.NewInt(0).Sub(lMin, rMin), big.NewInt(0).Sub(lMax, rMax), nil + return big.NewInt(0).Sub(lMin, rMax), big.NewInt(0).Sub(lMax, rMin), nil case t.KeyXBinaryStar: // TODO. if cv := lhs.ConstValue(); cv != nil && cv.Cmp(zero) == 0 {