Fix deflate decode when the distance is 32768

This commit is contained in:
Nigel Tao committed 2018-03-23 12:49:42 +11:00
1 parent 7de631fb96
commit 4675efdcc5
9 files changed
+115 -76

No files matched your search

+24
View File
@@ -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 {
+2
View File
@@ -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",