mirror of
https://github.com/golang/go
synced 2024-11-19 21:04:43 -07:00
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
This commit is contained in:
parent
c3dbf56a14
commit
337fe4134f
@ -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);
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user