]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo, runtime: add checks for passing pointers from Go to C
authorIan Lance Taylor <iant@golang.org>
Fri, 16 Oct 2015 22:26:00 +0000 (15:26 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Nov 2015 22:22:10 +0000 (22:22 +0000)
commit9dcc58c3d139ee0475fdaca8119812c014ec5ba1
treeb4f7dcc9a2e8819203fce7705dcaadce1ae5fc57
parent9c8cd83753fd3ebbe81a72469d8c74441123140c
cmd/cgo, runtime: add checks for passing pointers from Go to C

This implements part of the proposal in issue 12416 by adding dynamic
checks for passing pointers from Go to C.  This code is intended to be
on at all times.  It does not try to catch every case.  It does not
implement checks on calling Go functions from C.

The new cgo checks may be disabled using GODEBUG=cgocheck=0.

Update #12416.

Change-Id: I48de130e7e2e83fb99a1e176b2c856be38a4d3c8
Reviewed-on: https://go-review.googlesource.com/16003
Reviewed-by: Russ Cox <rsc@golang.org>
misc/cgo/errors/ptr.go [new file with mode: 0644]
misc/cgo/errors/test.bash
misc/cgo/test/callback.go
src/cmd/cgo/ast.go
src/cmd/cgo/doc.go
src/cmd/cgo/gcc.go
src/cmd/cgo/main.go
src/cmd/cgo/out.go
src/runtime/cgocall.go
src/runtime/runtime1.go
src/runtime/type.go