1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:34:53 -07:00
go/misc/cgo/errors
Didier Spezia 9c258c6aa6 cmd/cgo: fix panic on references to non-existing C types
cgo panics in Package.rewriteRef for:

var a = C.enum_test(1)
or
p := new(C.enum_test)

when the corresponding enum type is not defined.

Check nil values for Type fields and issue a proper
error instead.

Fixes #11097
Updates #12160

Change-Id: I5821d29097ef0a36076ec5273125b09846c7d832
Reviewed-on: https://go-review.googlesource.com/15264
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-10-05 22:37:07 +00:00
..
err1.go cmd/cgo: fix line number in an error message 2013-10-18 16:52:44 -04:00
err2.go cmd/cgo: fix line number in an error message 2013-10-18 16:52:44 -04:00
err3.go cmd/cgo: enforce typing of 0-sized types 2014-03-27 20:23:16 +00:00
issue7757.go cmd/cgo: make C function pointers non-assignable 2014-08-12 12:55:12 -07:00
issue8442.go cmd/cgo: check for compiler errors in the C preamble 2014-08-14 09:21:58 -07:00
issue11097a.go cmd/cgo: fix panic on references to non-existing C types 2015-10-05 22:37:07 +00:00
issue11097b.go cmd/cgo: fix panic on references to non-existing C types 2015-10-05 22:37:07 +00:00
test.bash cmd/cgo: fix panic on references to non-existing C types 2015-10-05 22:37:07 +00:00