summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1998-08-18 05:40:52 -0700
committerRichard Henderson <rth@gcc.gnu.org>1998-08-18 05:40:52 -0700
commit20045452636c20b9941102c5d4df386a2e364cb0 (patch)
tree0e8447e4d59b9716269463af5c9c34ff93a85890 /gcc/c-common.c
parenteaa41c8dd3ddfb7c8b8d8437a8130bd576a488e9 (diff)
downloadgcc-20045452636c20b9941102c5d4df386a2e364cb0.tar.gz
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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c12
1 files changed, 10 insertions, 2 deletions
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