diff options
author | Russ Cox <rsc@golang.org> | 2009-01-29 17:38:58 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-01-29 17:38:58 -0800 |
commit | 18f4ab31c9eb5d1ca1d02f972c2f596c9c83fd6c (patch) | |
tree | 346d845fb120717e657f7a2919d374290fe02f81 /src/cmd/6g/gsubr.c | |
parent | 5362c610e210efd2f7fa20dbaadab3127d34f516 (diff) | |
download | golang-18f4ab31c9eb5d1ca1d02f972c2f596c9c83fd6c.tar.gz |
if take address of local, move to heap.
heuristic to not print bogus strings.
fix one error message format.
R=ken
OCL=23849
CL=23851
Diffstat (limited to 'src/cmd/6g/gsubr.c')
-rw-r--r-- | src/cmd/6g/gsubr.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/6g/gsubr.c b/src/cmd/6g/gsubr.c index 86ba52c3f..cd4f6e294 100644 --- a/src/cmd/6g/gsubr.c +++ b/src/cmd/6g/gsubr.c @@ -547,6 +547,7 @@ gmove(Node *f, Node *t) break; case PAUTO: case PPARAM: + case PPARAMOUT: break; } break; @@ -1046,6 +1047,15 @@ naddr(Node *n, Addr *a) a->offset = n->xoffset; break; + case OPARAM: + // n->left is PHEAP ONAME for stack parameter. + // compute address of actual parameter on stack. + a->etype = n->left->type->etype; + a->offset = n->xoffset; + a->sym = n->left->sym; + a->type = D_PARAM; + break; + case ONAME: a->etype = 0; if(n->type != T) @@ -1071,6 +1081,7 @@ naddr(Node *n, Addr *a) a->type = D_AUTO; break; case PPARAM: + case PPARAMOUT: a->type = D_PARAM; break; } @@ -1749,6 +1760,7 @@ tempname(Node *n, Type *t) n->class = PAUTO; n->addable = 1; n->ullman = 1; + n->noescape = 1; dowidth(t); w = t->width; |