diff options
author | Tianon Gravi <admwiggin@gmail.com> | 2015-05-02 10:02:54 -0600 |
---|---|---|
committer | Tianon Gravi <admwiggin@gmail.com> | 2015-05-02 10:02:54 -0600 |
commit | 839657a730bd3c82d1b7932f996dd87448eb7d38 (patch) | |
tree | d46006c2df507ba8cfd57a47169d326349b5c749 /src/cmd/gc/inl.c | |
parent | 90ad8a7e5881be7834909c649f994b6b5244c965 (diff) | |
download | golang-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.c | 9 |
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); |