Commit 375b7bb7 authored by Keith Randall's avatar Keith Randall

cmd/gc: compute size of keys & values before making map bucket

Fixes #7547

LGTM=iant
R=iant, khr
CC=golang-codereviews
https://golang.org/cl/84470046
parent 1daa2520
......@@ -125,6 +125,8 @@ mapbucket(Type *t)
keytype = t->down;
valtype = t->type;
dowidth(keytype);
dowidth(valtype);
if(keytype->width > MAXKEYSIZE)
keytype = ptrto(keytype);
if(valtype->width > MAXVALSIZE)
......
// compile
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func f() map[string]interface{} {
var p *map[string]map[string]interface{}
_ = p
return nil
}
func main() {
f()
}
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