This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
PR java/14581: gcj internal error: Segmentation fault involving switch to a final var
- From: Andrew Haley <aph at redhat dot com>
- To: java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Cc: morell at cs dot atu dot edu
- Date: Mon, 15 Mar 2004 15:35:09 +0000
- Subject: PR java/14581: gcj internal error: Segmentation fault involving switch to a final var
Compiling:
class BugToken {
public void oops () {
final char eofSym;
switch (7) {
case eofSym : ;
}
}
}
yields:
javac BugToken.java
BugToken.java: In class `BugToken':
BugToken.java: In method `BugToken.oops()':
BugToken.java:4: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
Andrew.
2004-03-15 Andrew Haley <aph@redhat.com>
PR java/14581
* parse.y (java_complete_lhs): Check that final variable has an
initializer.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.472
diff -p -2 -c -r1.472 parse.y
*** parse.y 28 Feb 2004 00:34:25 -0000 1.472
--- parse.y 15 Mar 2004 15:22:24 -0000
*************** java_complete_lhs (tree node)
*** 11654,11658 ****
}
/* Accept final locals too. */
! else if (TREE_CODE (cn) == VAR_DECL && DECL_FINAL (cn))
cn = fold_constant_for_init (DECL_INITIAL (cn), cn);
--- 11654,11659 ----
}
/* Accept final locals too. */
! else if (TREE_CODE (cn) == VAR_DECL && DECL_FINAL (cn)
! && DECL_INITIAL (cn))
cn = fold_constant_for_init (DECL_INITIAL (cn), cn);