]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: skip exporting generic functions for -buildmode=plugin
authorMatthew Dempsky <mdempsky@google.com>
Tue, 17 May 2022 00:03:59 +0000 (17:03 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 17 May 2022 00:53:54 +0000 (00:53 +0000)
commitb79c135f377e2cbae888ef50b83f1ee5025af906
tree74fdd7ee08d6d5a05b9820c39b5c13619bf7da7c
parenta900a176bf946ac220336c7c5dad107745fc9c41
cmd/compile: skip exporting generic functions for -buildmode=plugin

Generic functions require instantiation, which package plugin doesn't
support, and likely never will. So instead, we can just skip writing
out any generic functions, which avoids an ICE in the plugin
generation code.

This issue doesn't affect GOEXPERIMENT=unified, because it avoids
leaking any non-instantiated types/functions to the rest of the
compiler backend.

Fixes #52937.

Change-Id: Ie35529c5c241e46b77fcb5b8cca48bb99ce7bfcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/406358
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/reflectdata/reflect.go
test/run.go
test/typeparam/issue52937.go [new file with mode: 0644]