1
0
mirror of https://github.com/golang/go synced 2024-11-26 12:58:06 -07:00
This commit is contained in:
Richard Wang 2023-09-14 14:11:50 +09:00
parent d72ee02451
commit 706facb9f2

View File

@ -530,9 +530,8 @@ const cgoResultFail = "cgo result is unpinned Go pointer or points to unpinned G
// cgoCheckArg is the real work of cgoCheckPointer. The argument p
// is either a pointer to the value (of type t), or the value itself,
// depending on indir. The top parameter is whether we are at the top
// level, where Go pointers are allowed. Go pointers to pinned objects that
// don't reference other unpinned pointers (enforced by cgoCheckUnknownPointer)
// are always allowed.
// level, where Go pointers are allowed. Go pointers to pinned objects are
// allowed as long as they don't reference other unpinned pointers.
func cgoCheckArg(t *_type, p unsafe.Pointer, indir, top bool, msg string) {
if t.PtrBytes == 0 || p == nil {
// If the type has no pointers there is nothing to do.