]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: simplify check for pointers in map bucket
authorMartin Möhrmann <moehrmann@google.com>
Tue, 29 Aug 2017 19:32:41 +0000 (21:32 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Wed, 30 Aug 2017 07:42:54 +0000 (07:42 +0000)
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>
src/cmd/compile/internal/gc/reflect.go

index a56edad3b46006bbb7c9bea5ffc7bae27d986542..9d9b43152ef121497f301fd75c1cb2264ba3a184 100644 (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)