]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] cmd/compile: fix re-export closure
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 10 Mar 2022 16:41:56 +0000 (23:41 +0700)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 14 Mar 2022 17:19:04 +0000 (17:19 +0000)
commit4b9b25a21dbf4d1f9c7dc2845c1feb67a4447c1c
tree57eea405a8408abdc8a69cdde345ac51bd5dfcd4
parentd69d093c77250a58c648756db42bbad8ad823770
[release-branch.go1.18] cmd/compile: fix re-export closure

For hidden closure built during stenciling to implement a function
instantiation, the function may come from other package, not local
package, which causes the ICE for code that re-export the hidden closure
after inlining.

To fix it, use the closure package for export writer when writing out
the closure itself.

Fixes #51423

Change-Id: I23b067ba14e2d602a0fc3b2e99bd9317afbe53ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/391574
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 9743e9b6d8e150639f509fc64e4bc5f24ecce562)
Reviewed-on: https://go-review.googlesource.com/c/go/+/391774
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
test/typeparam/issue51423.dir/a.go [new file with mode: 0644]
test/typeparam/issue51423.dir/b.go [new file with mode: 0644]
test/typeparam/issue51423.go [new file with mode: 0644]