diff options
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | libgo/go/reflect/all_test.go | 11 | ||||
-rw-r--r-- | libgo/go/reflect/type.go | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index d2fde07..eba9bd4 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -8b6c7f3f9762366bab96ea95b966e93e2593be13 +baf289294a026ddd30c9e4341aff528084337763 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/reflect/all_test.go b/libgo/go/reflect/all_test.go index 3378640..96b57ef 100644 --- a/libgo/go/reflect/all_test.go +++ b/libgo/go/reflect/all_test.go @@ -4411,6 +4411,17 @@ func TestStructOf(t *testing.T) { }) // check that type already in binary is found checkSameType(t, StructOf(fields[2:3]), struct{ Y uint64 }{}) + + // gccgo used to fail this test. + type structFieldType interface{} + checkSameType(t, + StructOf([]StructField{ + StructField{ + Name: "F", + Type: TypeOf((*structFieldType)(nil)).Elem(), + }, + }), + struct{ F structFieldType }{}) } func TestStructOfExportRules(t *testing.T) { diff --git a/libgo/go/reflect/type.go b/libgo/go/reflect/type.go index 458c456..07fe4d0 100644 --- a/libgo/go/reflect/type.go +++ b/libgo/go/reflect/type.go @@ -1912,7 +1912,7 @@ func isValidFieldName(fieldName string) bool { // This limitation may be lifted in a future version. func StructOf(fields []StructField) Type { var ( - hash = uint32(0) + hash = uint32(12) size uintptr typalign int8 comparable = true @@ -1997,7 +1997,7 @@ func StructOf(fields []StructField) Type { } fset[name] = struct{}{} - repr = append(repr, (" " + ft.String())...) + repr = append(repr, (" " + *ft.string)...) if f.tag != nil { repr = append(repr, (" " + strconv.Quote(*f.tag))...) } |