]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xcoffout.c (xcoff_assign_fundamental_type_number): Check DECL_NAME != 0 before derefe...
authorZack Weinberg <zack@codesourcery.com>
Fri, 13 Feb 2004 18:24:06 +0000 (18:24 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 13 Feb 2004 18:24:06 +0000 (18:24 +0000)
* xcoffout.c (xcoff_assign_fundamental_type_number): Check
DECL_NAME != 0 before dereferencing.

From-SVN: r77763

gcc/ChangeLog
gcc/xcoffout.c

index d5a3ce4aa0dc953d8d87bae6839b30a4fdf333fd..b3800835710f212225ba1d1a5587b0fbad6c372e 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-13  Zack Weinberg  <zack@codesourcery.com>
+
+       * xcoffout.c (xcoff_assign_fundamental_type_number): Check
+       DECL_NAME != 0 before dereferencing.
+
 2004-02-13  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390-protos.h (s390_output_symbolic_const): Remove.
index 447da746ac40c56333b7ecf94488901710afc470..de7528fbb4fbb522c7acfd150fabb4fadbd7f773 100644 (file)
@@ -152,13 +152,15 @@ static const struct xcoff_type_number xcoff_type_numbers[] = {
 int
 xcoff_assign_fundamental_type_number (tree decl)
 {
-  const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
+  const char *name;
   size_t i;
 
   /* Do not waste time searching the list for non-intrinsic types.  */
-  if (DECL_SOURCE_LINE (decl) > 0)
+  if (DECL_NAME (decl) == 0 || DECL_SOURCE_LINE (decl) > 0)
     return 0;
 
+  name = IDENTIFIER_POINTER (DECL_NAME (decl));
+
   /* Linear search, blech, but the list is too small to bother
      doing anything else.  */
   for (i = 0; i < ARRAY_SIZE (xcoff_type_numbers); i++)