runtime: work around escaping closure in export_test.go
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 10 Jan 2018 05:26:29 +0000 (05:26 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 10 Jan 2018 05:26:29 +0000 (05:26 +0000)
commit692aefcd5618a00e622a1c96957d943723040b4c
treeae7606fee60c2a35f1f871e4356eb9e02c1b4078
parente4876be5f5c5524ea742527100e36c5095181b28
runtime: work around escaping closure in export_test.go

    When compiling runtime, it is not allowed for local variables
    and closures to be heap allocated. In one test, there is a go
    statement with a closure. In the gc compiler, it distinguishes
    capturing variable by value vs. by address, and rewrites it to
    passing the captured values as arguments. Currently we don't
    have this, and the escape analysis decides to heap allocate the
    closure and also the captured variables, which is not allowed.
    Work around it by passing the variables explicitly.

    This is in preparation of turning on escape analysis for the
    runtime.

    Reviewed-on: https://go-review.googlesource.com/86245

From-SVN: r256419
gcc/go/gofrontend/MERGE
libgo/go/runtime/export_test.go