From: khr@golang.org Date: Sun, 17 Nov 2024 21:24:43 +0000 (-0800) Subject: internal/runtime/maps: fix noswiss builder X-Git-Tag: go1.24rc1~348 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=90b1dc0192b62e4007031cf8b472023da08f7ca7;p=gostls13.git internal/runtime/maps: fix noswiss builder Missed initializing a field in the stub that lets the noswiss builder test the swiss implementation. Change-Id: Ie093478ad3e4301e4fe88ba65c132a9dbccd89a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/628895 Auto-Submit: Keith Randall Reviewed-by: Cherry Mui Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI --- diff --git a/src/internal/runtime/maps/export_noswiss_test.go b/src/internal/runtime/maps/export_noswiss_test.go index 0cb262f207..333fc6ce90 100644 --- a/src/internal/runtime/maps/export_noswiss_test.go +++ b/src/internal/runtime/maps/export_noswiss_test.go @@ -33,12 +33,13 @@ func newTestMapType[K comparable, V any]() *abi.SwissMapType { var slot instantiatedSlot[K, V] mt := &abi.SwissMapType{ - Key: omt.Key, - Elem: omt.Elem, - Group: abi.TypeOf(grp), - Hasher: omt.Hasher, - SlotSize: unsafe.Sizeof(slot), - ElemOff: unsafe.Offsetof(slot.elem), + Key: omt.Key, + Elem: omt.Elem, + Group: abi.TypeOf(grp), + Hasher: omt.Hasher, + SlotSize: unsafe.Sizeof(slot), + GroupSize: unsafe.Sizeof(grp), + ElemOff: unsafe.Offsetof(slot.elem), } if omt.NeedKeyUpdate() { mt.Flags |= abi.SwissMapNeedKeyUpdate