]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix import of functions of multiple nested closure
authorDan Scales <danscales@google.com>
Fri, 19 Feb 2021 17:40:35 +0000 (09:40 -0800)
committerDan Scales <danscales@google.com>
Tue, 23 Feb 2021 01:53:51 +0000 (01:53 +0000)
commit5f3dabbb79fb3dc8eea9a5050557e9241793dce3
tree4a75c0169a1a4b0ad34684d09d9ac9e2069ba271
parent7af821a661be57cdd13212695cd6c1095487f2b4
cmd/compile: fix import of functions of multiple nested closure

For import of functions with closures, the connections among closure
variables are constructed on-the-fly via CaptureName(). For multiple
nested closures, we need to temporarily set r.curfn to each closure we
construct, so that the processing of closure variables will be correct
for any nested closure inside that closure.

Fixes #44335

Change-Id: I34f99e2822250542528ff6b2232bf36756140868
Reviewed-on: https://go-review.googlesource.com/c/go/+/294212
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/typecheck/iimport.go
test/fixedbugs/issue44335.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue44335.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue44335.go [new file with mode: 0644]