From 148fac79a33bf7e9be279002aa289eacad41cb8f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 25 Jun 2013 17:28:49 -0400 Subject: 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 #5773. R=golang-dev, r CC=golang-dev https://golang.org/cl/10570043 --- src/cmd/gc/esc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cmd/gc/esc.c b/src/cmd/gc/esc.c index df273e3927..497645ab59 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; } -- cgit v1.3-5-g9baa