aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorAlexandre Daubois <alex.daubois@gmail.com>2025-11-24 08:14:18 +0000
committerGopher Robot <gobot@golang.org>2025-11-24 11:58:55 -0800
commita593ca9d657efb1ea021c9fc51cb528c398bbf4e (patch)
treeb3625254161b0607c0fa9fdfaeee681a52d70361 /src/runtime
parent89552911b383b78cd8807ec747ca5df8ba52e239 (diff)
downloadgo-a593ca9d657efb1ea021c9fc51cb528c398bbf4e.tar.xz
runtime/cgo: add support for `any` param and return type
When using `any` as param or return type of an exported function, we currently have the error `unrecognized Go type any`. `any` is an alias of `interface{}` which is already supported. This would avoid such change: https://github.com/php/frankenphp/pull/1976 Fixes #76340 Change-Id: I301838ff72e99ae78b035a8eff2405f6a145ed1a GitHub-Last-Rev: 7dfbccfa582bbc6e79ed29677391b9ae81a9b5bd GitHub-Pull-Request: golang/go#76325 Reviewed-on: https://go-review.googlesource.com/c/go/+/720960 Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/cgocall.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index f01353ffa6..55e7bdbdb5 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -796,6 +796,9 @@ func cgoCheckResult(val any) {
ep := efaceOf(&val)
t := ep._type
+ if t == nil {
+ return
+ }
cgoCheckArg(t, ep.data, !t.IsDirectIface(), false, cgoResultFail)
}