mirror of
https://github.com/golang/go
synced 2024-10-03 21:21:22 -06:00
clear output parameters
R=r OCL=16345 CL=16345
This commit is contained in:
parent
5e92fb20b8
commit
d015f896bb
@ -20,6 +20,7 @@ compile(Node *fn)
|
|||||||
Node nod1;
|
Node nod1;
|
||||||
Prog *ptxt;
|
Prog *ptxt;
|
||||||
int32 lno;
|
int32 lno;
|
||||||
|
Type *t;
|
||||||
|
|
||||||
if(newproc == N) {
|
if(newproc == N) {
|
||||||
newproc = nod(ONAME, N, N);
|
newproc = nod(ONAME, N, N);
|
||||||
@ -56,6 +57,17 @@ if(throwreturn == N) {
|
|||||||
curfn = fn;
|
curfn = fn;
|
||||||
dowidth(curfn->type);
|
dowidth(curfn->type);
|
||||||
|
|
||||||
|
if(curfn->type->outnamed) {
|
||||||
|
// add clearing of the output parameters
|
||||||
|
t = structfirst(&pl, getoutarg(curfn->type));
|
||||||
|
while(t != T) {
|
||||||
|
if(t->nname != N && t->nname->sym->name[0] != '_') {
|
||||||
|
curfn->nbody = list(nod(OAS, t->nname, N), curfn->nbody);
|
||||||
|
}
|
||||||
|
t = structnext(&pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
walk(curfn);
|
walk(curfn);
|
||||||
if(nerrors != 0)
|
if(nerrors != 0)
|
||||||
goto ret;
|
goto ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user