From 20045452636c20b9941102c5d4df386a2e364cb0 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 18 Aug 1998 05:40:52 -0700 Subject: [PATCH] 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: r21824 --- gcc/ChangeLog | 5 +++++ gcc/c-common.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb093a5bf68..82eccb9e93a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 18 12:40:27 1998 Richard Henderson + + * c-common.c (decl_attributes): Issue an error if the argument + to alias is not a string. + Tue Aug 18 10:33:30 1998 Jeffrey A Law (law@cygnus.com) * Makefile.in (cplus-dem.o): Provide explicit rules for building diff --git a/gcc/c-common.c b/gcc/c-common.c index 6f14579f63f..9e4506760ad 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -855,8 +855,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 -- 2.30.2