From e8018fbebe2e6e86f94111b21c5749ebeea15dbd Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 31 Jul 2013 08:35:43 -0400 Subject: runtime: rewrite map size test I don't know why the memstats code is flaky. TBR=bradfitz CC=golang-dev https://golang.org/cl/12160043 --- src/pkg/runtime/hashmap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pkg/runtime/hashmap.c') diff --git a/src/pkg/runtime/hashmap.c b/src/pkg/runtime/hashmap.c index 7e0c9572dd..4b51436dc2 100644 --- a/src/pkg/runtime/hashmap.c +++ b/src/pkg/runtime/hashmap.c @@ -1112,6 +1112,9 @@ runtimeĀ·makemap_c(MapType *typ, int64 hint) Type *key; key = typ->key; + + if(sizeof(Hmap) > 48) + runtimeĀ·panicstring("hmap too large"); if(hint < 0 || (int32)hint != hint) runtimeĀ·panicstring("makemap: size out of range"); -- cgit v1.3-5-g9baa