mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Fix deflate decode when the distance is 32768
This commit is contained in:
1 parent
7de631fb96
commit
4675efdcc5
9 files changed
+115
-76
No files matched your search
@@ -26,6 +26,18 @@ var reasons = [...]struct {
|
||||
r reason
|
||||
}{
|
||||
|
||||
{`"a < b: b > a"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op.Key() != t.KeyXBinaryLessThan {
|
||||
return errFailed
|
||||
}
|
||||
// b > a
|
||||
if err := proveReasonRequirement(q, t.IDXBinaryGreaterThan, xb, xa); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a < b: a < c; c < b"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op.Key() != t.KeyXBinaryLessThan {
|
||||
@@ -126,6 +138,18 @@ var reasons = [...]struct {
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a <= b: b >= a"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op.Key() != t.KeyXBinaryLessEq {
|
||||
return errFailed
|
||||
}
|
||||
// b >= a
|
||||
if err := proveReasonRequirement(q, t.IDXBinaryGreaterEq, xb, xa); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a <= b: a <= c; c <= b"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op.Key() != t.KeyXBinaryLessEq {
|
||||
|
||||
@@ -30,12 +30,14 @@ import (
|
||||
)
|
||||
|
||||
var reasons = [...]string{
|
||||
"a < b: b > a",
|
||||
"a < b: a < c; c < b",
|
||||
"a < b: a < c; c == b",
|
||||
"a < b: a == c; c < b",
|
||||
"a < b: a < c; c <= b",
|
||||
"a < b: a <= c; c < b",
|
||||
|
||||
"a <= b: b >= a",
|
||||
"a <= b: a <= c; c <= b",
|
||||
"a <= b: a <= c; c == b",
|
||||
"a <= b: a == c; c <= b",
|
||||
|
||||
Reference in new issue
Block a user