]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: allow go'd closure to escape when compiling runtime
authorCherry Mui <cherryyz@google.com>
Thu, 3 Jun 2021 22:25:47 +0000 (18:25 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 4 Jun 2021 17:00:19 +0000 (17:00 +0000)
commit46beeed0ac4cd409554167c315861eaf8ae68c4a
treed3f6c1c4b1f4067f48f636e966b98267d88313ab
parent8e6dfe1b315ca0ef6497b28e16523c2dc4019503
[dev.typeparams] cmd/compile: allow go'd closure to escape when compiling runtime

When compiling runtime, we don't allow closures to escape,
because we don't want (implicit) allocations to occur when it is
not okay to allocate (e.g. in the allocator itself). However, for
go statement, it already allocates a new goroutine anyway. It is
okay to allocate the closure. Allow it.

Also include the closure's name when reporting error.

Updates #40724.

Change-Id: Id7574ed17cc27709609a059c4eaa67ba1c4436dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/325109
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/walk/order.go
test/fixedbugs/issue14999.go