]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: skip substituting closures in unsafe builtins arguments
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 16 Jun 2022 16:04:25 +0000 (23:04 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 18 Jun 2022 00:48:50 +0000 (00:48 +0000)
commit527ace0ffa81d59698d3a78ac3545de7295ea76b
tree9727ce930eff8ec76b657469e38dfd18abe15ce2
parentec58e3f3271de385cf976a805e611d3da09c3a0e
cmd/compile: skip substituting closures in unsafe builtins arguments

For unsafe.{Alignof,Offsetof,Sizeof}, subster will transform them them
to OLITERAL nodes, and discard their arguments. However, any closure in
their children nodes were already processed and added to declaration
queue. Thus, we lack of information for generating instantiation for
the closure.

To fix it, just skip substituting the closures if we are going to edit
the children nodes of unsafe builtins.

Fixes #53390

Change-Id: Ia815cd05af9dc0491f10faac4399f378ac53dec6
Reviewed-on: https://go-review.googlesource.com/c/go/+/412794
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/issue53390.go [new file with mode: 0644]