From 90b1dc0192b62e4007031cf8b472023da08f7ca7 Mon Sep 17 00:00:00 2001 From: "khr@golang.org" Date: Sun, 17 Nov 2024 13:24:43 -0800 Subject: [PATCH] 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 --- src/internal/runtime/maps/export_noswiss_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/internal/runtime/maps/export_noswiss_test.go b/src/internal/runtime/maps/export_noswiss_test.go index 0cb262f2073..333fc6ce90b 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