Bug 38702 - Compiler generates illegal bytecode in switch statement. VerifyError.
Summary: Compiler generates illegal bytecode in switch statement. VerifyError.
Status: RESOLVED DUPLICATE of bug 37621
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.0 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-10 09:30 EDT by Eckart Langhuth CLA
Modified: 2003-06-10 09:32 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eckart Langhuth CLA 2003-06-10 09:30:20 EDT
Using Version: 2.1.0 Build id: 200303202147

Compiling and running the Main class listed below results in the error:
java.lang.VerifyError: (class: test/Main, method: ResultType signature: ()V) 
Illegal target of jump or branch
Exception in thread "main"

This seems to be a new problem.
(The code comes from some generated code which worked properly in older 
versions. I just tested Eclipse 2.1 M3 build and it's ok)

I tried to find the essence of the problem in the switch block. Even small 
changes solve the problem.
(For example: removing case 2:break; block or replace default : throw 
newException(); with default : System.out.println();)

package test;
public class Main {
  private int i = 0;
  public static void main(String[] args) {
    System.out.println("Hello");
  }
  final public void ResultType() throws Exception {
    switch (i) {
      case 1 :
        if (true)
          throw new Exception();
        break;
      case 2 :
        break;
      default :
        throw new Exception();
    }
  }
}
Comment 1 Philipe Mulet CLA 2003-06-10 09:32:44 EDT

*** This bug has been marked as a duplicate of 37621 ***