diff options
Diffstat (limited to 'src/internal/runtime/maps/map_test.go')
| -rw-r--r-- | src/internal/runtime/maps/map_test.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/internal/runtime/maps/map_test.go b/src/internal/runtime/maps/map_test.go index 53b4a62071..d11535657b 100644 --- a/src/internal/runtime/maps/map_test.go +++ b/src/internal/runtime/maps/map_test.go @@ -6,8 +6,8 @@ package maps_test import ( "fmt" + "internal/abi" "internal/runtime/maps" - "internal/runtime/maps/internal/abi" "math" "testing" "unsafe" @@ -444,4 +444,11 @@ func TestTableZeroSizeSlot(t *testing.T) { if gotElem != elem { t.Errorf("Get(%d) got elem %d want %d", key, gotElem, elem) } + + start := tab.GroupsStart() + length := tab.GroupsLength() + end := unsafe.Pointer(uintptr(start) + length*tab.Type().Group.Size() - 1) // inclusive to ensure we have a valid pointer + if uintptr(got) < uintptr(start) || uintptr(got) > uintptr(end) { + t.Errorf("elem address outside groups allocation; got %p want [%p, %p]", got, start, end) + } } |
