diff options
| author | Michael Pratt <mpratt@google.com> | 2024-09-17 18:00:21 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-10-30 15:11:27 +0000 |
| commit | b5fec2cf54ff9f7b562cb904a2a025266aec2763 (patch) | |
| tree | be774c2cef2df29292da32aa083577c207fe2500 /src/internal/runtime/maps/table_debug.go | |
| parent | 2220fd36368c96da3dd833bdc2bbd13be291216a (diff) | |
| download | go-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/table_debug.go')
| -rw-r--r-- | src/internal/runtime/maps/table_debug.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/internal/runtime/maps/table_debug.go b/src/internal/runtime/maps/table_debug.go index 27ae611ec3..345f1feb6e 100644 --- a/src/internal/runtime/maps/table_debug.go +++ b/src/internal/runtime/maps/table_debug.go @@ -35,6 +35,9 @@ func (t *table) checkInvariants(typ *abi.SwissMapType) { used++ key := g.key(typ, j) + if typ.IndirectKey() { + key = *((*unsafe.Pointer)(key)) + } // Can't lookup keys that don't compare equal // to themselves (e.g., NaN). |
