From: ian Date: Thu, 27 Jan 2011 20:39:19 +0000 (+0000) Subject: Fix self-referential struct via function and array. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ea7da2795c9725989c6c74e17360e998cf4b030;p=thirdparty%2Fgcc.git Fix self-referential struct via function and array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169339 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index a70f5e9a3d0c..aa331c2698c6 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -3763,7 +3763,7 @@ Struct_type::fill_in_tree(Gogo* gogo, tree type) // Don't follow pointers yet, so that we don't get confused by a // pointer to an array of this struct type. tree field_type_tree; - if (p->type()->points_to() != NULL) + if (p->type()->points_to() != NULL || p->type()->function_type() != NULL) { field_type_tree = ptr_type_node; has_pointer = true; @@ -3793,7 +3793,8 @@ Struct_type::fill_in_tree(Gogo* gogo, tree type) p != this->fields_->end(); ++p, field = DECL_CHAIN(field)) { - if (p->type()->points_to() != NULL) + if (p->type()->points_to() != NULL + || p->type()->function_type() != NULL) TREE_TYPE(field) = p->type()->get_tree(gogo); } }