Bug 69319 - JDK 1.4, assertions cause VerifyError
Summary: JDK 1.4, assertions cause VerifyError
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows 2000
: P3 blocker (vote)
Target Milestone: 1.2.1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-05 15:31 EDT by Andriy Palamarchuk CLA
Modified: 2004-10-21 04:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Palamarchuk CLA 2004-07-05 15:31:23 EDT
When running some classes compiled with Sun JDK 1.4 in mode -source 1.4 I get
following error:
java.lang.VerifyError: (class: Test, method: method1 signature: ()V) Expecting
to find integer on stack
The methods with assertions are not even called!

Steps to reproduce:
1) Create following class:

public class Test {
  private void method1() {
    try {
      invoke();
    } catch (Throwable throwable) {
      assert false : throwable;
    }
  }
  private void invoke() {}
  public static void main(String[] args) {}
}

2) compile it with ajc:

ajc -source 1.4 Test.java

3) run the resulting class:

java Test

What should happen:
The class should successfully execute.

What really happens:
The class fails with following output:
**********************************
java Test
java.lang.VerifyError: (class: Test, method: method1 signature: ()V) Expecting
to find integer on stack
Exception in thread "main" 
**********************************

Additional comments:
The bug is reproducable in both - 1.2 and development download (as on today).
I use j2sdk1.4.2_03.

Please let me know if you need additional information.

Regards,
Andriy Palamarchuk
Comment 1 Adrian Colyer CLA 2004-07-30 04:24:20 EDT
Since this is a pure java program, I was curious to see what the Eclipse java 
compiler made of it, in the 3.0 M6 milestone release (the version of their 
compiler inside AspectJ 1.2). Sure enough...

java.lang.VerifyError: (class: Test, method: method1 signature: ()V) Expecting 
to find integer on stack
Exception in thread "main" 

The program compiles happily under Eclipse 3.0 final, so this bug should be 
fixed as I upgrade the compiler level inside AspectJ.
Comment 2 Adrian Colyer CLA 2004-07-30 16:43:13 EDT
Just completed the compiler upgrade, and the bug is now resolved. Will close 
this report once the fix is available in a published build.
Comment 3 Andrew Clement CLA 2004-08-02 07:16:11 EDT
Fix now available in latest build from AspectJ download page.
Comment 4 Adrian Colyer CLA 2004-10-21 04:32:16 EDT
Fix released as part of AspectJ 1.2.1