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-2808) [drlvm] VM crashes instead of throwing VerifyError when used class overrides final method
Date Wed, 20 Dec 2006 06:46:23 GMT
[drlvm] VM crashes instead of throwing VerifyError when used class overrides final method
-----------------------------------------------------------------------------------------

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


VM crashes when it tries to load class which contains overridden final method.
The following test which uses attached synthetic classes demonstrates this issue:
 ----------finTest.java----------
public class finTest {
    public static void main(String args[]) {
        try {
            new finTest1().test();
            System.out.println("Test failed. VerifyError was not thrown");
        } catch (VerifyError e) {
            System.out.println("Test passed: "+e);
        } catch (Throwable e) {
            System.out.println("Test failed: unexpected "+e);
 	    e.printStackTrace();
	}
    }
}
----------------finTest1.jj--------------
.class public finTest1
.super java/lang/Object
;
; standard initializer
.method public <init>()V
   aload_0
   invokespecial java/lang/Object/<init>()V
   return
.end method 
; final method
.method public final testMethod()I
  .limit locals 2
  .limit stack 2
  sipush 1
  ireturn
.end method
;
.method public test()V
  .limit stack 2
  .limit locals 2
  new finTest2
  dup
  invokespecial finTest2/<init>()V
  aload 0
  invokevirtual finTest2/testMethod()V
  return
.end method
--------------finTest2.jj------------------
.class public finTest2
.super finTest1
;
; standard initializer
.method public <init>()V
   aload_0
   invokespecial finTest1/<init>()V
   return
.end method 
;
.method public final testMethod()I
  .limit locals 2
  .limit stack 2
  sipush 2
  ireturn
.end method
-----------------


-- 
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