diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 3e1f26b866..c436c55c6a 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -96,7 +96,8 @@ func makefield(name string, t *types.Type) *types.Field { return f } -func mapbucket(t *types.Type) *types.Type { +// bmap makes the map bucket type given the type of the map. +func bmap(t *types.Type) *types.Type { if t.MapType().Bucket != nil { return t.MapType().Bucket } @@ -204,16 +205,16 @@ func mapbucket(t *types.Type) *types.Type { Fatalf("bucket align not multiple of value align %v", t) } if keys.Offset%int64(keytype.Align) != 0 { - Fatalf("bad alignment of keys in mapbucket for %v", t) + Fatalf("bad alignment of keys in bmap for %v", t) } if values.Offset%int64(valtype.Align) != 0 { - Fatalf("bad alignment of values in mapbucket for %v", t) + Fatalf("bad alignment of values in bmap for %v", t) } // Double-check that overflow field is final memory in struct, // with no padding at end. See comment above. if overflow.Offset != bucket.Width-int64(Widthptr) { - Fatalf("bad offset of overflow in mapbucket for %v", t) + Fatalf("bad offset of overflow in bmap for %v", t) } t.MapType().Bucket = bucket @@ -229,7 +230,7 @@ func hmap(t *types.Type) *types.Type { return t.MapType().Hmap } - bmap := mapbucket(t) + bmap := bmap(t) // build a struct: // type hmap struct { @@ -281,7 +282,7 @@ func hiter(t *types.Type) *types.Type { } hmap := hmap(t) - bmap := mapbucket(t) + bmap := bmap(t) // build a struct: // type hiter struct { @@ -1301,7 +1302,7 @@ ok: case TMAP: s1 := dtypesym(t.Key()) s2 := dtypesym(t.Val()) - s3 := dtypesym(mapbucket(t)) + s3 := dtypesym(bmap(t)) s4 := dtypesym(hmap(t)) ot = dcommontype(lsym, ot, t) ot = dsymptr(lsym, ot, s1.Linksym(), 0) @@ -1324,7 +1325,7 @@ ok: ot = duint8(lsym, ot, 0) // not indirect } - ot = duint16(lsym, ot, uint16(mapbucket(t).Width)) + ot = duint16(lsym, ot, uint16(bmap(t).Width)) ot = duint8(lsym, ot, uint8(obj.Bool2int(isreflexive(t.Key())))) ot = duint8(lsym, ot, uint8(obj.Bool2int(needkeyupdate(t.Key())))) ot = dextratype(lsym, ot, t, 0) diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index e85e4ba8f5..e98514255a 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -1464,7 +1464,7 @@ opswitch: // are stored with an indirection. So max bucket size is 2048+eps. // var bv bmap - bv := temp(mapbucket(t)) + bv := temp(bmap(t)) zero = nod(OAS, bv, nil) zero = typecheck(zero, Etop)