This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: java/5135: Compiler segfault on non public Interfaces
- From: Tom Tromey <tromey at redhat dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 17 Dec 2001 01:46:03 -0000
- Subject: Re: java/5135: Compiler segfault on non public Interfaces
- Reply-to: Tom Tromey <tromey at redhat dot com>
The following reply was made to PR java/5135; it has been noted by GNATS.
From: Tom Tromey <tromey@redhat.com>
To: olivier@zipworld.com.au
Cc: gcc-gnats@gcc.gnu.org, Alexandre Petit-Bianco <apbianco@cygnus.com>
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;
}