Commit a68b98cf by Richard Kenner

(lookup_field): Don't recurse unless FIELD is a RECORD_TYPE or

UNION_TYPE.

From-SVN: r13870
parent 06140bdf
/* Build expressions with type checking for C compiler. /* Build expressions with type checking for C compiler.
Copyright (C) 1987, 88, 91, 92-6, 1997 Free Software Foundation, Inc. Copyright (C) 1987, 88, 91-6, 1997 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -1151,10 +1151,13 @@ lookup_field (type, component, indirect) ...@@ -1151,10 +1151,13 @@ lookup_field (type, component, indirect)
/* Step through all anon unions in linear fashion. */ /* Step through all anon unions in linear fashion. */
while (DECL_NAME (field_array[bot]) == NULL_TREE) while (DECL_NAME (field_array[bot]) == NULL_TREE)
{ {
tree anon, junk; tree anon = 0, junk;
field = field_array[bot++]; field = field_array[bot++];
if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
anon = lookup_field (TREE_TYPE (field), component, &junk); anon = lookup_field (TREE_TYPE (field), component, &junk);
if (anon != NULL_TREE) if (anon != NULL_TREE)
{ {
*indirect = field; *indirect = field;
...@@ -1190,7 +1193,12 @@ lookup_field (type, component, indirect) ...@@ -1190,7 +1193,12 @@ lookup_field (type, component, indirect)
if (DECL_NAME (field) == NULL_TREE) if (DECL_NAME (field) == NULL_TREE)
{ {
tree junk; tree junk;
tree anon = lookup_field (TREE_TYPE (field), component, &junk); tree anon = 0;
if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
anon = lookup_field (TREE_TYPE (field), component, &junk);
if (anon != NULL_TREE) if (anon != NULL_TREE)
{ {
*indirect = field; *indirect = field;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment