This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Java: Fix PR 16701
Bryce McKinlay writes:
> Andrew Haley wrote:
>
> >Bryce McKinlay writes:
> > > This patch fixes PR 16701. fold_constant_for_init() recursively resolves
> > > other constants, but it didn't update the global current_class before
> > > calling resolve_field_access(). This resulted in access checks being
> > > performed from the wrong context.
> >
> >I think you need to check the return value of resolve_field_access().
> >If resolve_field_access() fails returning error_mark_node, no-one has
> >initialized decl.
> >
> >
> I agree. Note that the original code had this bug too. I've checked in
> this variant which adds a check for an error_mark_node return value from
> resolve_field_access (resolve_field_access should never return NULL,
> only a valid decl or error_mark_node)
>
> 2004-08-02 Bryce McKinlay <mckinlay@redhat.com>
>
> PR java/16701
> * parse.y (fold_constant_for_init): Call resolve_field_access with
> correct current_class context.
Cool.
Andrew.