This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: RFA: Fix PR java/21844
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: tromey at redhat dot com
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 07 Jun 2005 13:02:16 +0530
- Subject: Re: Patch: RFA: Fix PR java/21844
- References: <m37jh7utry.fsf@localhost.localdomain>
Tom Tromey wrote:
> This fixes PR java/21844.
>
> The problem occurs if we are making an outer reference to an inherited
> field. In this case nested_field_access_p incorrectly returned false,
> and as a result we referenced the field against 'this' rather than
> 'this$0'. (Seems like this could be caught by type checking code in
> some later pass, were it to exist.)
Sorry for this inadvertant breakage! :-(
> --- gcc/java/parse.y 6 Jun 2005 19:31:35 -0000 1.537
> +++ gcc/java/parse.y 6 Jun 2005 20:13:28 -0000
> @@ -8416,6 +8416,13 @@
> if (type_root == decl_type_root)
> return 1;
>
> + /* Before we give up, see whether it is a non-static field
> + inherited from the enclosing context we are considering. */
> + if (!DECL_CONTEXT (TYPE_NAME (type_root))
> + && !is_static
> + && inherits_from_p (type_root, decl_type))
> + return 1;
> +
> return 0;
See parse.y:8393, which is *supposed* to handle the same
case. Before my patch, the "for" loop was peeking ahead
and handling this case. Perhaps you can correct the look
ahead at the mentioned line and retry?
Thanks,
Ranjit.
--
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/