]> Cypherpunks repositories - gostls13.git/commit
test: demo for issue 7695
authorRuss Cox <rsc@golang.org>
Thu, 17 Apr 2014 03:06:37 +0000 (23:06 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 17 Apr 2014 03:06:37 +0000 (23:06 -0400)
commitdc370995a87a37b43546a9ac3413d533d24e0665
tree2aba914459337335af7cc9d4d929d683e745fab2
parent6277cc3df578455c22a0da4deb4213d8db4c9ffe
test: demo for issue 7695

Cgo writes C function declarations pretending every arg is a pointer.
If the C function is deferred, it does not inhibit stack copying on split.
The stack copying code believes the C declaration, possibly misinterpreting
integers as pointers.

Probably the right fix for Go 1.3 is to make deferred C functions inhibit
stack copying.

For Go 1.4 and beyond we probably need to make cgo generate Go code
for 6g here, not C code for 6c.

Update #7695

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/83820043
misc/cgo/test/backdoor/backdoor.go
misc/cgo/test/backdoor/runtime.c
misc/cgo/test/issue7695_test.go [new file with mode: 0644]