Commit fe3ee574 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: verify hmap type size

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, khr
https://golang.org/cl/114510044
parent d514e291
......@@ -153,8 +153,8 @@ func evacuated(b *bmap) bool {
}
func makemap(t *maptype, hint int64) *hmap {
if unsafe.Sizeof(hmap{}) > 48 {
gothrow("hmap too large")
if sz := unsafe.Sizeof(hmap{}); sz > 48 || sz != uintptr(t.hmap.size) {
gothrow("bad hmap size")
}
if hint < 0 || int64(int32(hint)) != hint {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment