1
0
mirror of https://github.com/golang/go synced 2024-11-24 02:00:20 -07:00
go/misc/cgo/errors/issue18889.go
Alexander Menzhinsky 2463a49ebb cmd/cgo: reject references to builtin functions other than calls
Here we restrict using cgo builtin references because internally they're go functions
as opposed to C usafe.Pointer values.

Fixes #18889

Change-Id: I1e4332e4884063ccbaf9772c172d4462ec8f3d13
Reviewed-on: https://go-review.googlesource.com/40934
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-18 22:14:43 +00:00

8 lines
70 B
Go

package main
import "C"
func main() {
_ = C.malloc // ERROR HERE
}