-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Milestone
Description
Compiling this code with gccgo:
package p
import "unsafe"
type T struct {
x int
y int
z [unsafe.Offsetof(T{}.y)]int
}
produces this crash:
x.go:5:6: error: invalid recursive type 'T'
type T struct {
^
go1: internal compiler error: Segmentation fault
0xc133bf crash_signal
/usr/local/google/tmp/go-build-release/gccgo-srcdir/gcc/toplev.c:326
0x7208dd Type::is_backend_type_size_known(Gogo*)
/usr/local/google/tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/types.cc:3382
0x725e58 Struct_type::backend_field_offset(Gogo*, unsigned int, long*)
/usr/local/google/tmp/go-build-release/gccgo-srcdir/gcc/go/gofrontend/types.cc:6439
[...]
(cmd/compile and go/types also reject the code, though each with slightly different error messages.)