diff options
author | Russ Cox <rsc@golang.org> | 2013-06-25 17:28:49 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2013-06-25 17:28:49 -0400 |
commit | bc02462567e0c9568ea7946058fa6c2c43c19541 (patch) | |
tree | 64f565439cb4d5fb463208da6637e701ab354972 /src/cmd | |
parent | 843a7dd249872f92978c7c5591e47a3594fad86d (diff) | |
download | go-bc02462567e0c9568ea7946058fa6c2c43c19541.tar.gz |
cmd/gc: fix escape analysis ordering
Functions without bodies were excluded from the ordering logic,
because when I wrote the ordering logic there was no reason to
analyze them.
But then we added //go:noescape tags that need analysis, and we
didn't update the ordering logic.
So in the absence of good ordering, //go:noescape only worked
if it appeared before the use in the source code.
Fixes issue 5773.
R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/10570043
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/gc/esc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/gc/esc.c b/src/cmd/gc/esc.c index df273e392..497645ab5 100644 --- a/src/cmd/gc/esc.c +++ b/src/cmd/gc/esc.c @@ -144,7 +144,7 @@ visitcode(Node *n, uint32 min) fn = n->left; if(n->op == OCALLMETH) fn = n->left->right->sym->def; - if(fn && fn->op == ONAME && fn->class == PFUNC && fn->defn && fn->defn->nbody) + if(fn && fn->op == ONAME && fn->class == PFUNC && fn->defn) if((m = visit(fn->defn)) < min) min = m; } |