]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (decl_attributes): Issue an error if the argument to alias is not a string.
authorRichard Henderson <rth@cygnus.com>
Tue, 18 Aug 1998 22:49:52 +0000 (15:49 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 18 Aug 1998 22:49:52 +0000 (16:49 -0600)
        * c-common.c (decl_attributes): Issue an error if the argument
        to alias is not a string.

From-SVN: r21837

gcc/ChangeLog
gcc/c-common.c

index 6f05e8c4b4fa32a522ea5864d7b994ad071478c1..9d925bc40b93c09b7e0ecde7ef35f424c1e4c9a9 100644 (file)
@@ -1,3 +1,8 @@
+Tue Aug 18 23:48:30 1998  Richard Henderson <rth@cygnus.com>
+
+       * 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.
index 245fedb97be344908cf20188f8d18c6bd3a29403..5803ab675d37ba20820e9bf1825c678ad820c6eb 100644 (file)
@@ -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