This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Wrong code generation
- From: Michael Koch <konqueror at gmx dot de>
- To: java at gcc dot gnu dot org
- Date: Tue, 18 Mar 2003 15:43:03 +0100
- Subject: Wrong code generation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
The attached testcase produces wrong bytecode when compiled with gcj.
When compiled and run with Sun's JDK it prints "Michael". ;-)
When compiled with gcj and run with Sun's java it prints:
Exception in thread "main" java.lang.VerifyError: (class: InvokeTest,
method: test signature: ()V) Illegal use of nonvirtual function call
(Thats a testcase I made for a bug found when bootstrapping ant 1.5.2)
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+dzB7WSOgCCdjSDsRAhuUAJ9ULhlp4fQI5vde1TIdgeuWt2ZQVACfT+Sj
zD6Zvl0obokiB7iCFLBTQjA=
=R7/7
-----END PGP SIGNATURE-----
public class InvokeTest
{
public static void main (String[] args)
{
InvokeTest i = new InvokeTest ();
i.test ();
}
InvokeTest ()
{
}
public void test ()
{
InnerClass c = new InnerClass ();
c.invoke ();
}
public class InnerClass
{
InnerClass ()
{
}
private void invoke ()
{
System.out.println ("Michael");
}
}
}