re PR java/14581 (gcj internal error: Segmentation fault involving switch to a final...
authorAndrew Haley <aph@redhat.com>
Mon, 15 Mar 2004 17:56:14 +0000 (17:56 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Mon, 15 Mar 2004 17:56:14 +0000 (17:56 +0000)
2004-03-15  Andrew Haley  <aph@redhat.com>

        PR java/14581
        * parse.y (java_complete_lhs): Check that final variable has an
        initializer.

From-SVN: r79505

gcc/java/ChangeLog
gcc/java/parse.y

index f080725a1e293be719944e1b16363b043f691af7..2657d62f870d083565366f2438fe08920c2e9561 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-15  Andrew Haley  <aph@redhat.com>
+
+       PR java/14581
+       * parse.y (java_complete_lhs): Check that final variable has an
+       initializer.
+
 2004-03-12  Andrew Haley  <aph@redhat.com>
 
        PR java/14551
index 14bec8d01f522d6720b0beda55ea999021c2efbc..049e50b08ffb024ff8d720439503771b1dde0da4 100644 (file)
@@ -11653,7 +11653,8 @@ java_complete_lhs (tree node)
                                       TREE_OPERAND (cn, 1));
        }
       /* Accept final locals too. */
-      else if (TREE_CODE (cn) == VAR_DECL && DECL_FINAL (cn))
+      else if (TREE_CODE (cn) == VAR_DECL && DECL_FINAL (cn) 
+              && DECL_INITIAL (cn))
        cn = fold_constant_for_init (DECL_INITIAL (cn), cn);
 
       if (!TREE_CONSTANT (cn) && !flag_emit_xref)