1
0
mirror of https://github.com/golang/go synced 2024-09-29 18:34:33 -06:00
go/misc/cgo
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
..
errors cmd/cgo: fix panic on references to non-existing C types 2015-10-05 22:37:07 +00:00
gmp Fix several out of date references to 4g/5g/6g/8g/9g. 2015-06-26 03:38:21 +00:00
life
nocgo cmd/ld: really import runtime/cgo for external link 2014-05-20 21:36:50 -07:00
stdio
test runtime: unblock special glibc signals on each thread 2015-09-14 21:59:54 +00:00
testasan runtime: more flexible heap memory mapping on 64-bits 2013-06-12 18:47:16 +04:00
testcarchive cmd/go: install headers for c-archive/c-shared cgo exports 2015-05-07 17:39:56 +00:00
testcshared cmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared object 2015-09-08 23:34:16 +00:00
testgodefs build: convert run.bash, run.bat, and run.rc into a Go program 2015-03-03 23:22:11 +00:00
testsanitizers misc/cgo/testsanitizers: skip test for version of clang before 3.6 2015-10-02 14:17:33 +00:00
testshared cmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared object 2015-09-08 23:34:16 +00:00
testsigfwd runtime: signal forwarding 2015-04-24 05:19:39 +00:00
testso cmd/dist: convert testso test into Go 2015-06-12 04:33:50 +00:00
testsovar misc/cgo/testsovar: needs the extern keyword to export variables on non-windows platforms 2015-07-21 18:10:57 +00:00
testtls misc/cgo/testtls: make test less flaky 2014-01-21 19:44:51 -05:00