diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-04-08 18:56:38 -0700 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-04-08 18:56:38 -0700 |
| commit | c8b2b725e098bdc85130f2e00ea43c74a4c4346d (patch) | |
| tree | af159d5111586968786f2f7b315369e79a5272b5 /src/pkg/runtime | |
| parent | 77a0b96f2f779717f801173aacd35f2b2041dd9e (diff) | |
| download | go-c8b2b725e098bdc85130f2e00ea43c74a4c4346d.tar.xz | |
runtime: fix integer overflow in hashmap
The test is problematic, because it requires 8GB+ of RAM.
Fixes #5239.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8550043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/hashmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/hashmap.c b/src/pkg/runtime/hashmap.c index 0f32d94e0f..892f0a1700 100644 --- a/src/pkg/runtime/hashmap.c +++ b/src/pkg/runtime/hashmap.c @@ -451,7 +451,7 @@ hash_grow(MapType *t, Hmap *h) old_buckets = h->buckets; // NOTE: this could be a big malloc, but since we don't need zeroing it is probably fast. if(checkgc) mstats.next_gc = mstats.heap_alloc; - new_buckets = runtime·mallocgc(h->bucketsize << (h->B + 1), 0, 1, 0); + new_buckets = runtime·mallocgc((uintptr)h->bucketsize << (h->B + 1), 0, 1, 0); flags = (h->flags & ~(Iterator | OldIterator)); if((h->flags & Iterator) != 0) { flags |= OldIterator; |
