This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: fix for <clinit> generation.
- To: egcs-patches at egcs dot cygnus dot com
- Subject: [PATCH] Java: fix for <clinit> generation.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Thu, 27 Apr 2000 16:24:50 -0700
- Reply-to: apbianco at redhat dot com
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);