aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-27 20:39:19 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-27 20:39:19 +0000
commit2887665c943a4d67bda6f6410503fcfae6d6b7fa (patch)
treeb5162c1d8f0d58a737308fab03e55342c80a9291
parentb5fa435a2a972656b05a715a4af0a7ef52be66df (diff)
downloadgcc-2887665c943a4d67bda6f6410503fcfae6d6b7fa.zip
gcc-2887665c943a4d67bda6f6410503fcfae6d6b7fa.tar.gz
gcc-2887665c943a4d67bda6f6410503fcfae6d6b7fa.tar.bz2
Fix self-referential struct via function and array.
From-SVN: r169339
-rw-r--r--gcc/go/gofrontend/types.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index a70f5e9..aa331c2 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);
}
}