summaryrefslogtreecommitdiff
path: root/src/cmd/gc/inl.c
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2015-05-02 10:02:54 -0600
committerTianon Gravi <admwiggin@gmail.com>2015-05-02 10:02:54 -0600
commit839657a730bd3c82d1b7932f996dd87448eb7d38 (patch)
treed46006c2df507ba8cfd57a47169d326349b5c749 /src/cmd/gc/inl.c
parent90ad8a7e5881be7834909c649f994b6b5244c965 (diff)
downloadgolang-upstream-sid.tar.gz
Imported Upstream version 1.4.2upstream/1.4.2upstream-sid
Diffstat (limited to 'src/cmd/gc/inl.c')
-rw-r--r--src/cmd/gc/inl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cmd/gc/inl.c b/src/cmd/gc/inl.c
index cf89b0090..45e15bb9b 100644
--- a/src/cmd/gc/inl.c
+++ b/src/cmd/gc/inl.c
@@ -804,9 +804,12 @@ inlvar(Node *var)
n->curfn = curfn; // the calling function, not the called one
n->addrtaken = var->addrtaken;
- // esc pass wont run if we're inlining into a iface wrapper
- // luckily, we can steal the results from the target func
- if(var->esc == EscHeap)
+ // Esc pass wont run if we're inlining into a iface wrapper.
+ // Luckily, we can steal the results from the target func.
+ // If inlining a function defined in another package after
+ // escape analysis is done, treat all local vars as escaping.
+ // See issue 9537.
+ if(var->esc == EscHeap || (inl_nonlocal && var->op == ONAME))
addrescapes(n);
curfn->dcl = list(curfn->dcl, n);