1
0
mirror of https://github.com/golang/go synced 2024-10-02 22:21:20 -06:00

cmd/compile: simplify check for pointers in map bucket

Change-Id: Ie5e977c54f50274421962a7ca268ae71a6f19cef
Reviewed-on: https://go-review.googlesource.com/60050
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Martin Möhrmann 2017-08-29 21:32:41 +02:00
parent 54125d191d
commit 2548d36c86

View File

@ -157,7 +157,7 @@ func mapbucket(t *types.Type) *types.Type {
// the type of the overflow field to uintptr in this case.
// See comment on hmap.overflow in ../../../../runtime/hashmap.go.
otyp := types.NewPtr(bucket)
if !types.Haspointers(t.Val()) && !types.Haspointers(t.Key()) && t.Val().Width <= MAXVALSIZE && t.Key().Width <= MAXKEYSIZE {
if !types.Haspointers(valtype) && !types.Haspointers(keytype) {
otyp = types.Types[TUINTPTR]
}
overflow := makefield("overflow", otyp)