c-decl.c (finish_decl): Add else's to avoid referencing TYPE_DOMAIN of an ERROR_MARK.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Wed, 20 Sep 2000 19:35:10 +0000 (19:35 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 20 Sep 2000 19:35:10 +0000 (15:35 -0400)
* c-decl.c (finish_decl): Add else's to avoid referencing
TYPE_DOMAIN of an ERROR_MARK.

From-SVN: r36554

gcc/ChangeLog
gcc/c-decl.c

index b4b3480732c0c5fd7b02eac08cc006612d29cdf5..84f70971a01261038de13dda3860d41aa7c3215f 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 20 15:39:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * c-decl.c (finish_decl): Add else's to avoid referencing
+       TYPE_DOMAIN of an ERROR_MARK.
+
 Wed Sep 20 21:44:31 2000  Denis Chertykov  <denisc@overta.ru>
 
        * config/avr/avr.c (adjust_insn_length): Adjust lengths of
index c892719855f91947e0d582bca6ef65f8b0344819..a197601407ac0acf1ece80d229a7eeb1c17e6bb3 100644 (file)
@@ -3635,7 +3635,7 @@ finish_decl (decl, init, asmspec_tree)
       if (failure == 1)
        error_with_decl (decl, "initializer fails to determine size of `%s'");
 
-      if (failure == 2)
+      else if (failure == 2)
        {
          if (do_default)
            error_with_decl (decl, "array size missing in `%s'");
@@ -3652,8 +3652,8 @@ finish_decl (decl, init, asmspec_tree)
       /* TYPE_MAX_VALUE is always one less than the number of elements
         in the array, because we start counting at zero.  Therefore,
         warn only if the value is less than zero.  */
-      if (pedantic && TYPE_DOMAIN (type) != 0
-         && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0)
+      else if (pedantic && TYPE_DOMAIN (type) != 0
+             && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0)
        error_with_decl (decl, "zero or negative size array `%s'");
 
       layout_decl (decl, 0);