This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: Fix for PR java/17216
- From: Andrew Haley <aph at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Mon, 13 Sep 2004 17:43:32 +0100
- Subject: Patch: RFA: Fix for PR java/17216
- References: <874qmojb92.fsf@fleche.redhat.com>
Tom Tromey writes:
> This fixes PR java/17216.
>
> `javac -target 1.1' will emit redeclarations of Miranda methods in the
> abstract class where they enter the concrete class hierarchy. These
> redeclarations are marked Synthetic.
>
> In the test case in the PR, the subclass implements the method, so the
> search in layout_class_method finds an overridden method. However,
> synthetic (DECL_ARTIFICIAL) methods aren't included in the vtable
> layout; so we see a crash because the overriding method in the
> subclass ends up with a NULL vtable index.
>
> I don't see why DECL_ARTIFICIAL methods should be omitted from the
> vtable. Is there a reason? Removing this doesn't seem to cause any
> problems.
DECL_ARTIFICIAL is used for JNI stubs and methods marked "Synthetic".
I can't see any good reason that synthetic methods were ever ommitted
from vtables except to save space.
Your patch seems OK. Please check it in.
Andrew.