]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: don't allow escaping arguments in the runtime package.
authorKeith Randall <khr@golang.org>
Tue, 29 Jul 2014 21:38:08 +0000 (14:38 -0700)
committerKeith Randall <khr@golang.org>
Tue, 29 Jul 2014 21:38:08 +0000 (14:38 -0700)
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

src/cmd/gc/walk.c

index 41d49f57b3dab4f09699dc9a901e64a479026f9b..eb9ce1131691b3f21b0bc9f52f5d862694debff6 100644 (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));