aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-06-18 13:58:57 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-06-18 13:58:57 -0700
commit1d33b2a9b9f2b7d119bdb15812f8dd1cf958687e (patch)
tree55fab2e754c707e44ed599f606c3988151ec50ff
parentabdf3eea96d2ffcac162ff32b08d973ce29a1aff (diff)
downloadgcc-1d33b2a9b9f2b7d119bdb15812f8dd1cf958687e.zip
gcc-1d33b2a9b9f2b7d119bdb15812f8dd1cf958687e.tar.gz
gcc-1d33b2a9b9f2b7d119bdb15812f8dd1cf958687e.tar.bz2
(process_init_element): For fieldtype, don't access
TYPE_MAIN_VARIANT field if the type is error_mark_node. From-SVN: r7521
-rw-r--r--gcc/c-typeck.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 7742e35..659a3e3 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -5999,7 +5999,9 @@ process_init_element (value)
break;
}
- fieldtype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_fields));
+ fieldtype = TREE_TYPE (constructor_fields);
+ if (fieldtype != error_mark_node)
+ fieldtype = TYPE_MAIN_VARIANT (fieldtype);
fieldcode = TREE_CODE (fieldtype);
/* Accept a string constant to initialize a subarray. */
@@ -6060,7 +6062,9 @@ process_init_element (value)
break;
}
- fieldtype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_fields));
+ fieldtype = TREE_TYPE (constructor_fields);
+ if (fieldtype != error_mark_node)
+ fieldtype = TYPE_MAIN_VARIANT (fieldtype);
fieldcode = TREE_CODE (fieldtype);
/* Accept a string constant to initialize a subarray. */