From: Richard Henderson Date: Tue, 18 Aug 1998 22:49:52 +0000 (-0700) Subject: c-common.c (decl_attributes): Issue an error if the argument to alias is not a string. X-Git-Tag: prereleases/egcs-1.1-prerelease~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d68447e24007664490121059b7644e080b559ca2;p=thirdparty%2Fgcc.git c-common.c (decl_attributes): Issue an error if the argument to alias is not a string. * c-common.c (decl_attributes): Issue an error if the argument to alias is not a string. From-SVN: r21837 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f05e8c4b4fa..9d925bc40b93 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 18 23:48:30 1998 Richard Henderson + + * c-common.c (decl_attributes): Issue an error if the argument + to alias is not a string. + Tue Aug 18 13:05:59 BST 1998 Richard Earnshaw (rearnsha@arm.com) * arm.c (arm_override_options): Remove lie about ignoring PIC flag. diff --git a/gcc/c-common.c b/gcc/c-common.c index 245fedb97be3..5803ab675d37 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -845,8 +845,16 @@ decl_attributes (node, attributes, prefix_attributes) "`%s' defined both normally and as an alias"); else if (decl_function_context (decl) == 0) { - tree id = get_identifier (TREE_STRING_POINTER - (TREE_VALUE (args))); + tree id; + + id = TREE_VALUE (args); + if (TREE_CODE (id) != STRING_CST) + { + error ("alias arg not a string"); + break; + } + id = get_identifier (TREE_STRING_POINTER (id)); + if (TREE_CODE (decl) == FUNCTION_DECL) DECL_INITIAL (decl) = error_mark_node; else