]> Cypherpunks repositories - gostls13.git/commit
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)
committerKeith Randall <khr@golang.org>
Fri, 11 Mar 2022 00:42:08 +0000 (00:42 +0000)
commit9743e9b6d8e150639f509fc64e4bc5f24ecce562
tree1fcd5f714ae4233dddae904ad385026a20d7eba3
parent5003ed884a67ee26b4cedbe6f5b1c02bd5eb6630
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>
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]