]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.4] 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)
committerAndrew Gerrand <adg@golang.org>
Tue, 17 Feb 2015 23:36:32 +0000 (23:36 +0000)
commit3e5977f99d3e77a326ee1cef711c3e099285fba8
tree89b4420b1a813d1a7b1107cc7e3de14d301c414d
parent02cf0526bf76e5990ae3c2a9942866320de0bde3
[release-branch.go1.4] 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>
(cherry picked from commit ec0ebc2281f79294c299ece35c5a690a6415e0e0)
Reviewed-on: https://go-review.googlesource.com/5003
Run-TryBot: Andrew Gerrand <adg@golang.org>
Reviewed-by: Andrew Gerrand <adg@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]