From: Russ Cox Date: Tue, 16 Sep 2014 13:58:17 +0000 (-0400) Subject: cmd/gc: make runtime escape an error, not a fatal error X-Git-Tag: go1.4beta1~402 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=337fe4134fe733377db6025d67cfe01a9608099a;p=gostls13.git cmd/gc: make runtime escape an error, not a fatal error 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 --- diff --git a/src/cmd/gc/gen.c b/src/cmd/gc/gen.c index 86acd88259..83c46c6504 100644 --- a/src/cmd/gc/gen.c +++ b/src/cmd/gc/gen.c @@ -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); diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index a30fa62a6b..713348c0c0 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -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));