]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: treat non-local vars inlined into wrapper as escaping
authorIan Lance Taylor <iant@golang.org>
Wed, 21 Jan 2015 05:32:22 +0000 (21:32 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 22 Jan 2015 03:25:12 +0000 (03:25 +0000)
commitec0ebc2281f79294c299ece35c5a690a6415e0e0
tree8a5691835ea9f16c8615e4fde3612be55938db28
parent98d914201b98a854c7d172837d19ff7d0096b405
cmd/gc: treat non-local vars inlined into wrapper as escaping

The compiler has a phase ordering problem.  Escape analysis runs
before wrapper generation.  When a generated wrapper calls a method
defined in a different package, if that call is inlined, there will be
no escape information for the variables defined in the inlined call.
Those variables will be placed on the stack, which fails if they
actually do escape.

There are probably various complex ways to fix this.  This is a simple
way to avoid it: when a generated wrapper calls a method defined in a
different package, treat all local variables as escaping.

Fixes #9537.

Change-Id: I530f39346de16ad173371c6c3f69cc189351a4e9
Reviewed-on: https://go-review.googlesource.com/3092
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/gc/go.h
src/cmd/gc/inl.c
src/cmd/gc/subr.c
test/fixedbugs/issue9537.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue9537.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue9537.go [new file with mode: 0644]