harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vera Petrashkova (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2095) [drlvm][jit] Jitrino/OPT does not throw IncompatibaleClassChangeError when objectref in invokeinterface instruction refers to the class which does not implement used interface
Date Wed, 08 Nov 2006 05:42:51 GMT
[drlvm][jit] Jitrino/OPT does not throw IncompatibaleClassChangeError when objectref in invokeinterface
instruction refers to the class which does  not implement used interface
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2095
                 URL: http://issues.apache.org/jira/browse/HARMONY-2095
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows and Linux
            Reporter: Vera Petrashkova
         Attachments: intfTest.zip

If  objectref in invokeinterface instruction refers to the class which does  not implement
used interface Jitrino/OPT does not throw IncompatibaleClassChangeError.

To reproduce this bug run the following intfTest. It invokes class intf_cl_2 which was created
from jasmin code:
------------------intfTest.java------------------
import java.io.*;
public class intfTest {

    public static void main (String[] args) {

        try {
             System.out.println("Test failed: " + new intf_cl_2().test());
        } catch (IncompatibleClassChangeError e) {
             System.out.println("Test passed: " + e);
             e.printStackTrace();
        } catch (Throwable e) {
             System.out.println("Test failed: unexpected error");
             e.printStackTrace();
        }
    }
}
-----------------------------------------------
public interface intf_1 {
    public abstract int intfMethod();
}
-----------------------------------------------
public interface intf_2 {
    public abstract int intfMethod();
}
----------------------------------------------
public class intf_cl_1 implements intf_1 {
    public int intfMethod() {
        return 105;
    }
}
---------------------------------------------
.class public intf_cl_2
.super java/lang/Object
;
; standard initializer
.method public <init>()V
   aload_0
   invokespecial java/lang/Object/<init>()V
   return
.end method 
;
; test method
.method public test()I
  .limit locals 2
  .limit stack 2
  new intf_cl_1
  dup
  invokespecial intf_cl_1/<init>()V
  invokeinterface intf_2/intfMethod()I 1
  bipush 105
  ireturn
.end method
---------------------------------------------------
Create intf_cl_2 class using jasmin.jar 
    java -cp jasmin.jar intf_cl_2.jj

or use class file from attachment
And run test:
java -cp . -Xem:opt intfTest


Output on Harmony (JitrinioJET and Interpreter)
=====================================
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its l
icensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r471468, (Nov  7 2006), Windows/ia32/msvc 1310, release build
http://incubator.apache.org/harmony
Test passed: java.lang.IncompatibleClassChangeError: intf_2
java.lang.IncompatibleClassChangeError: intf_2
        at intf_cl_2.test(intf_cl_2.jj)
        at intfTest.main(intfTest.java:7)


Output on Harmony (Jitrino/OPT)
=============================
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0" 
pre-alpha : not complete or compatible
svn = r471468, (Nov  7 2006), Linux/ia32/icc 900, release build
http://incubator.apache.org/harmony
Test failed: 105


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message