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


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

[PATCH] Java: fix for <clinit> generation.


Tom Tromey noted that <clinit> calls _Jv_InitClass. This shouldn't
happen. I checked in this small patch which fixes the situation.

./A

Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* decl.c (complete_start_java_method): Don't call _Jv_InitClass
 	from <clinit>

Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/decl.c,v
retrieving revision 1.60
diff -u -p -r1.60 decl.c
--- decl.c	2000/04/04 20:40:19	1.60
+++ decl.c	2000/04/26 21:29:14
@@ -1692,6 +1692,7 @@ complete_start_java_method (fndecl)
 
   if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl)
       && ! flag_emit_class_files
+      && ! DECL_CLINIT_P (fndecl)
       && ! CLASS_INTERFACE (TYPE_NAME (current_class)))
     {
       tree clas = DECL_CONTEXT (fndecl);

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