Commit 2548d36c authored by Martin Möhrmann's avatar Martin Möhrmann

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: 's avatarKeith Randall <khr@golang.org>
parent 54125d19
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment