From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26445 invoked by alias); 17 Dec 2001 01:46:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26402 invoked by uid 71); 17 Dec 2001 01:46:03 -0000 Date: Sun, 16 Dec 2001 17:46:00 -0000 Message-ID: <20011217014603.26396.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: Re: java/5135: Compiler segfault on non public Interfaces Reply-To: Tom Tromey X-SW-Source: 2001-12/txt/msg00934.txt.bz2 List-Id: The following reply was made to PR java/5135; it has been noted by GNATS. From: Tom Tromey To: olivier@zipworld.com.au Cc: gcc-gnats@gcc.gnu.org, Alexandre Petit-Bianco Subject: Re: java/5135: Compiler segfault on non public Interfaces Date: 16 Dec 2001 18:51:24 -0700 Olivier> Note that "A" and therefore "A.Hello" are protected in Olivier> package "a" and should not be accessible from class "C". First, thanks for your report. It is concise and self-contained -- exactly how I like bug reports. I looked at this a bit today. gcj does correctly detect that A.HELLO is inaccessible, but unfortunately it crashes while trying to tell you that. The appended patch fixes the crash, but I think this patch is almost certainly incorrect. I don't really understand the code in this function. Something else I don't understand is that if you get rid of class `a.B', then the error in check_pkg_class_access is printed. Why does the presence of B make a difference here? Tom Index: parse.y =================================================================== RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v retrieving revision 1.333 diff -u -r1.333 parse.y --- parse.y 2001/12/16 16:23:49 1.333 +++ parse.y 2001/12/17 01:40:13 @@ -9660,10 +9659,9 @@ if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) { parse_error_context - (qual_wfl, "Can't access %s field `%s.%s' from `%s'", + (qual_wfl, "Can't access %s `%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (decl)), - GET_TYPE_NAME (type), - IDENTIFIER_POINTER (DECL_NAME (decl)), + GET_TYPE_NAME (TREE_TYPE (decl)), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); return 1; }