summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
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