Check copy_from_history32's distance.

This commit is contained in:
Nigel Tao committed 2017-11-09 12:53:19 +11:00
1 parent 67fb7bf1dc
commit 30b54616a8
6 files changed
+52 -17

No files matched your search

+4
View File
@@ -98,6 +98,10 @@ const (
FlagsGlobalIdent = Flags(0x00000100)
)
// flagsThatMatterForEq is the bitwise or of all flags that matter for the
// Expr.Eq method.
const flagsThatMatterForEq = Flags(0x0000FFFF)
// These flags are set by the bounds checker to generate optimized code.
const (
// FlagsProvenNotToSuspend notes that a method such as read_u8 or
+1 -1
View File
@@ -35,7 +35,7 @@ func (n *Expr) Eq(o *Expr) bool {
return n.constValue.Cmp(o.constValue) == 0
}
if n.flags != o.flags || n.id0 != o.id0 || n.id1 != o.id1 {
if (n.flags&flagsThatMatterForEq) != (o.flags&flagsThatMatterForEq) || n.id0 != o.id0 || n.id1 != o.id1 {
return false
}
if !n.lhs.Expr().Eq(o.lhs.Expr()) {