This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/13378] gcj compiling from jar files - verification error
- From: "mckinlay at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2005 01:29:26 -0000
- Subject: [Bug java/13378] gcj compiling from jar files - verification error
- References: <20031210191512.13378.norbertf@gmx.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mckinlay at redhat dot com 2005-03-10 01:29 -------
This is failing because the bytecode in this .jar really is broken:
public class Test
{
public static void main(String[] args) throws Exception
{
Class f = Class.forName("org.eclipse.jface.util.OpenStrategy$1");
System.out.println (f);
}
}
$ java Test
Exception in thread "main" java.lang.VerifyError: (class:
org/eclipse/jface/util/OpenStrategy$1, method: handleEvent signature:
(Lorg/eclipse/swt/widgets/Event;)V) Register 2 contains wrong type
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at Test.main(Test.java:7)
However, its questionable whether gcj should actually report this error with
--indirect-dispatch. The verifier is correctly deferring this type check to
runtime via a type assertion but code in expr.c is still doing its own check
(hangover from the old verifier, I guess). Then again its probably a reasonable
assumption to make that java.lang.Object is never assignment-compatible to
anything else.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13378