Allow r.skip32_fast!(actual: x, worst_case: x)

This commit is contained in:
Nigel Tao committed 2020-02-19 14:09:43 +11:00
1 parent 67306567f9
commit 0aacdfd6e3
1 file changed
+3 -1
+3 -1
View File
@@ -1060,7 +1060,9 @@ func (q *checker) bcheckExprCallSpecialCases(n *a.Expr, depth uint32) (bounds, e
}
actual := args[0].AsArg().Value()
worstCase := args[1].AsArg().Value()
if err := q.proveBinaryOp(t.IDXBinaryLessEq, actual, worstCase); err == errFailed {
if actual.Eq(worstCase) {
// No-op. Proving "x <= x" is trivial.
} else if err := q.proveBinaryOp(t.IDXBinaryLessEq, actual, worstCase); err == errFailed {
return bounds{}, fmt.Errorf("check: could not prove skip_fast pre-condition: %s <= %s",
actual.Str(q.tm), worstCase.Str(q.tm))
} else if err != nil {