]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo, runtime: recognize unsafe.Pointer(&s[0]) in cgo pointer checks
authorIan Lance Taylor <iant@golang.org>
Thu, 7 Jan 2016 23:22:39 +0000 (15:22 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Jan 2016 03:56:30 +0000 (03:56 +0000)
commitd91ec5bb40bac5ce2c8136110c52723b35476985
tree18164c27c315f22ce0f3ce337249b2297dd2aa0d
parente84dad3f6e394f15739db46d9f319f94a1537667
cmd/cgo, runtime: recognize unsafe.Pointer(&s[0]) in cgo pointer checks

It's fairly common to call cgo functions with conversions to
unsafe.Pointer or other C types.  Apply the simpler checking of address
expressions when possible when the address expression occurs within a
type conversion.

Change-Id: I5187d4eb4d27a6542621c396cad9ee4b8647d1cd
Reviewed-on: https://go-review.googlesource.com/18391
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
misc/cgo/errors/ptr.go
src/cmd/cgo/gcc.go
src/runtime/cgocall.go