This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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");
    }
  }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]