Skip to content

Commit 29cd29c

Browse files
committed
runtime/cgo: fix cgoCheckArg description
The comment is misleading: cgoCheckArg is called by both cgoCheckPointer and cgoCheckResult. fix by adding cgoCheckResult in the cgoCheckArg description. GH: #75856
1 parent 0c14000 commit 29cd29c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/runtime/cgocall.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,9 @@ func cgoCheckPointer(ptr any, arg any) {
594594
const cgoCheckPointerFail = "cgo argument has Go pointer to unpinned Go pointer"
595595
const cgoResultFail = "cgo result is unpinned Go pointer or points to unpinned Go pointer"
596596

597-
// cgoCheckArg is the real work of cgoCheckPointer. The argument p
598-
// is either a pointer to the value (of type t), or the value itself,
599-
// depending on indir. The top parameter is whether we are at the top
597+
// cgoCheckArg is the real work of cgoCheckPointer and cgoCheckResult.
598+
// The argument p is either a pointer to the value (of type t), or the value
599+
// itself, depending on indir. The top parameter is whether we are at the top
600600
// level, where Go pointers are allowed. Go pointers to pinned objects are
601601
// allowed as long as they don't reference other unpinned pointers.
602602
func cgoCheckArg(t *_type, p unsafe.Pointer, indir, top bool, msg string) {

0 commit comments

Comments
 (0)