This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: static initializer fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 11 Jul 2005 10:29:50 -0600
- Subject: [gcjx] Patch: FYI: static initializer fix
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
We don't want to initialize the class from inside <clinit>.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* tree.cc (visit_method): Don't initialize class from static
initializer.
Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.47
diff -u -r1.1.2.47 tree.cc
--- tree.cc 11 Jul 2005 16:31:26 -0000 1.1.2.47
+++ tree.cc 11 Jul 2005 16:31:54 -0000
@@ -146,7 +146,7 @@
tree statements = alloc_stmt_list ();
tree_stmt_iterator out = tsi_start (statements);
- if (meth->static_p ())
+ if (meth->static_p () && ! meth->static_initializer_p ())
{
tree init
= gcc_builtins->build_class_init (meth->get_declaring_class ());