diff options
author | Richard Stallman <rms@gnu.org> | 1993-06-22 06:07:19 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-06-22 06:07:19 +0000 |
commit | f537a5c50ff2883952bb0befc2e0a5110fdc7029 (patch) | |
tree | e4ff6e9b47f334567dc6211dfb3a623479465ad3 /gcc | |
parent | a0466a68245dbef92227b1e88891b1c771772bf2 (diff) | |
download | gcc-f537a5c50ff2883952bb0befc2e0a5110fdc7029.zip gcc-f537a5c50ff2883952bb0befc2e0a5110fdc7029.tar.gz gcc-f537a5c50ff2883952bb0befc2e0a5110fdc7029.tar.bz2 |
(grokdeclarator): Avoid the use of macros for ..._TYPE
nodes in cases where a parameter's type is error_mark_node.
From-SVN: r4708
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 5a347e3..08f003e 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4457,13 +4457,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) When there is a prototype, this is overridden later. */ DECL_ARG_TYPE (decl) = type; - main_type = TYPE_MAIN_VARIANT (type); + main_type = (type == error_mark_node + ? error_mark_node + : TYPE_MAIN_VARIANT (type)); if (main_type == float_type_node) DECL_ARG_TYPE (decl) = double_type_node; /* Don't use TYPE_PRECISION to decide whether to promote, because we should convert short if it's the same size as int, but we should not convert long if it's the same size as int. */ - else if (C_PROMOTING_INTEGER_TYPE_P (main_type)) + else if (TREE_CODE (main_type) != ERROR_MARK + && C_PROMOTING_INTEGER_TYPE_P (main_type)) { if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node) && TREE_UNSIGNED (type)) |