This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/20338] Program compiled with gcj crashes when accessing private static method from nested class
- From: "rmathew at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 9 Mar 2005 12:39:30 -0000
- Subject: [Bug java/20338] Program compiled with gcj crashes when accessing private static method from nested class
- References: <20050305231532.20338.zbigniew@chyla.homeip.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rmathew at gcc dot gnu dot org 2005-03-09 12:39 -------
The problem is that we leave out a call to _Jv_InitClass for a static
private method thinking that it is unreachable. This is not the case
for a private static inner class method. A simple pessimistic
fix is:
Index: decl.c
===================================================================
--- decl.c 2005-03-09 17:16:36.000000000 +0530
+++ decl.c 2005-03-09 17:17:18.000000000 +0530
@@ -2039,5 +2039,5 @@ finish_method (tree fndecl)
/* Prepend class initialization for static methods reachable from
other classes. */
- if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl)
+ if (METHOD_STATIC (fndecl)
&& ! DECL_CLINIT_P (fndecl)
&& ! CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (fndecl))))
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-03-05 23:20:15 |2005-03-09 12:39:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20338