cmd/compile: fix.gc.Type.cmp for map.notBucket cmp map.Bucket

Comparison of certain map types could fail to be antisymmetric.
This corrects that.

Change-Id: I88c6256053ce29950ced4ba4d538e241ee8591fe
Reviewed-on: https://go-review.googlesource.com/22552
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: jcd . <jcd@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
David Chase 2016-04-28 10:46:08 -04:00
parent 9faf5cdf9d
commit 5ec87ba554
1 changed files with 2 additions and 0 deletions

View File

@ -992,6 +992,8 @@ func (t *Type) cmp(x *Type) ssa.Cmp {
return ssa.CMPlt // bucket maps are least
}
return t.StructType().Map.cmp(x.StructType().Map)
} else if x.StructType().Map.MapType().Bucket == x {
return ssa.CMPgt // bucket maps are least
} // If t != t.Map.Bucket, fall through to general case
fallthrough