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 12:40:52 +0000 (05:40 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 18 Aug 1998 12:40:52 +0000 (05:40 -0700)
* c-common.c (decl_attributes): Issue an error if the argument
to alias is not a string.

From-SVN: r21824

gcc/ChangeLog
gcc/c-common.c

index bb093a5bf680aa1cb833cd201dc85b5bbed8798a..82eccb9e93a61667e9e85f3a5e662d21a45b995f 100644 (file)
@@ -1,3 +1,8 @@
+Tue Aug 18 12:40:27 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 10:33:30 1998  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in (cplus-dem.o): Provide explicit rules for building
index 6f14579f63f216cafc594ed5b8aae5a382e103ca..9e4506760ad27cd8d0b4475db4f5da7840780102 100644 (file)
@@ -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