]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: make runtime escape an error, not a fatal error
authorRuss Cox <rsc@golang.org>
Tue, 16 Sep 2014 13:58:17 +0000 (09:58 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 16 Sep 2014 13:58:17 +0000 (09:58 -0400)
It is more useful to report all the errors instead of just the first.

LGTM=dave, khr
R=khr, dave
CC=golang-codereviews
https://golang.org/cl/143940043

src/cmd/gc/gen.c
src/cmd/gc/walk.c

index 86acd882598321a1c2b7934b03cf49a162edd47c..83c46c6504413e09540ba9c8d1e31243d5dd15e4 100644 (file)
@@ -585,7 +585,7 @@ cgen_dcl(Node *n)
        if(!(n->class & PHEAP))
                return;
        if(compiling_runtime)
-               fatal("%N escapes to heap, not allowed in runtime.", n);
+               yyerror("%N escapes to heap, not allowed in runtime.", n);
        if(n->alloc == nil)
                n->alloc = callnew(n->type);
        cgen_as(n->heapaddr, n->alloc);
index a30fa62a6b78d9ec5228559e9bc1259ccc502ef8..713348c0c07522a26c33049d4e5ca1d5c1916921 100644 (file)
@@ -2505,7 +2505,7 @@ paramstoheap(Type **argin, int out)
 
                // generate allocation & copying code
                if(compiling_runtime)
-                       fatal("%N escapes to heap, not allowed in runtime.", v);
+                       yyerror("%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));