aboutsummaryrefslogtreecommitdiff
path: root/src/internal/runtime/maps/export_test.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-09-17 18:00:21 -0400
committerGopher Robot <gobot@golang.org>2024-10-30 15:11:27 +0000
commitb5fec2cf54ff9f7b562cb904a2a025266aec2763 (patch)
treebe774c2cef2df29292da32aa083577c207fe2500 /src/internal/runtime/maps/export_test.go
parent2220fd36368c96da3dd833bdc2bbd13be291216a (diff)
downloadgo-b5fec2cf54ff9f7b562cb904a2a025266aec2763.tar.xz
cmd/compile,runtime: add indirect key/elem to swissmap
We use the same heuristics as existing maps. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap Change-Id: I44bb51483cae2c1714717f1b501850fb9e55a39a Reviewed-on: https://go-review.googlesource.com/c/go/+/616461 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/internal/runtime/maps/export_test.go')
-rw-r--r--src/internal/runtime/maps/export_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/internal/runtime/maps/export_test.go b/src/internal/runtime/maps/export_test.go
index 151c11fba8..c9c1da6a1c 100644
--- a/src/internal/runtime/maps/export_test.go
+++ b/src/internal/runtime/maps/export_test.go
@@ -86,7 +86,11 @@ func (m *Map) KeyFromFullGroup(typ *abi.SwissMapType) unsafe.Pointer {
if g.ctrls().get(j) == ctrlDeleted {
continue
}
- return g.key(typ, j)
+ slotKey := g.key(typ, j)
+ if typ.IndirectKey() {
+ slotKey = *((*unsafe.Pointer)(slotKey))
+ }
+ return slotKey
}
}
}