]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: clarify error when returning unpinned pointers
authorRichard Wang <richardwa@google.com>
Thu, 14 Sep 2023 05:13:40 +0000 (05:13 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 8 Nov 2023 17:51:19 +0000 (17:51 +0000)
commiteebeca803d6df0d3434106d7f6ebb87229c54fd7
tree2bf6a3d48502426b515796920db0b235e5b66354
parent6a1bbca2b3129b18f7d7e63b51536da2e9afe9e2
runtime: clarify error when returning unpinned pointers

With the introduction of runtime.Pinner, returning a pointer to a pinned
struct that then points to an unpinned Go pointer is correctly caught.

However, the error message remained as "cgo result has Go pointer",
which should be updated to acknowledge that Go pointers to pinned
memory are allowed.

This also updates the comments for cgoCheckArg and cgoCheckResult
to similarly clarify.

Updates #46787

Change-Id: I147bb09e87dfb70a24d6d43e4cf84e8bcc2aff48
GitHub-Last-Rev: 706facb9f2bf28e1f6e575b7626f8feeca1187cf
GitHub-Pull-Request: golang/go#62606
Reviewed-on: https://go-review.googlesource.com/c/go/+/527702
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/runtime/cgocall.go