mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Allow r.skip32_fast!(actual: x, worst_case: x)
This commit is contained in:
1 parent
67306567f9
commit
0aacdfd6e3
1 file changed
+3
-1
@@ -1060,7 +1060,9 @@ func (q *checker) bcheckExprCallSpecialCases(n *a.Expr, depth uint32) (bounds, e
|
|||||||
}
|
}
|
||||||
actual := args[0].AsArg().Value()
|
actual := args[0].AsArg().Value()
|
||||||
worstCase := args[1].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",
|
return bounds{}, fmt.Errorf("check: could not prove skip_fast pre-condition: %s <= %s",
|
||||||
actual.Str(q.tm), worstCase.Str(q.tm))
|
actual.Str(q.tm), worstCase.Str(q.tm))
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user