From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27235 invoked by alias); 9 Mar 2005 12:39:33 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 27200 invoked by uid 48); 9 Mar 2005 12:39:30 -0000 Date: Wed, 09 Mar 2005 14:51:00 -0000 Message-ID: <20050309123930.27199.qmail@sourceware.org> From: "rmathew at gcc dot gnu dot org" To: java-prs@gcc.gnu.org In-Reply-To: <20050305231532.20338.zbigniew@chyla.homeip.net> References: <20050305231532.20338.zbigniew@chyla.homeip.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/20338] Program compiled with gcj crashes when accessing private static method from nested class X-Bugzilla-Reason: CC X-SW-Source: 2005-q1/txt/msg00666.txt.bz2 List-Id: ------- 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