]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: correct comment on Package.rewriteCall
authorIan Lance Taylor <iant@golang.org>
Thu, 20 Oct 2016 18:10:03 +0000 (11:10 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 20 Oct 2016 18:27:05 +0000 (18:27 +0000)
Account for changes in https://golang.org/cl/31233.

Change-Id: I3311c6850a3c714d18209fdff500dd817e9dfcb2
Reviewed-on: https://go-review.googlesource.com/31594
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/cgo/gcc.go

index 714d6360ccb5b49fb22eb1722d7af10c10e6db70..408d9eea9e1875b86761ca11e28f38387fef1a2d 100644 (file)
@@ -615,8 +615,10 @@ func (p *Package) rewriteCalls(f *File) bool {
        return needsUnsafe
 }
 
-// rewriteCall rewrites one call to add pointer checks. We replace
-// each pointer argument x with _cgoCheckPointer(x).(T).
+// rewriteCall rewrites one call to add pointer checks.
+// If any pointer checks are required, we rewrite the call into a
+// function literal that calls _cgoCheckPointer for each pointer
+// argument and then calls the original function.
 // This returns whether the package needs to import unsafe as _cgo_unsafe.
 func (p *Package) rewriteCall(f *File, call *Call, name *Name) bool {
        // Avoid a crash if the number of arguments is