1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:28:33 -06:00

cmd/gc: don't allow escaping arguments in the runtime package.

This is a case that was missed in https://golang.org/cl/105280047/

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/120910043
This commit is contained in:
Keith Randall 2014-07-29 14:38:08 -07:00
parent fbfd32b80c
commit d2204e6c0e

View File

@ -2356,6 +2356,8 @@ paramstoheap(Type **argin, int out)
continue;
// generate allocation & copying code
if(compiling_runtime)
fatal("%N escapes to heap, not allowed in runtime.", v);
if(v->alloc == nil)
v->alloc = callnew(v->type);
nn = list(nn, nod(OAS, v->heapaddr, v->alloc));