This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcjx] Patch: FYI: static initializer fix


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 ());


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]