Bug 37040 - VerifyError "Illegal target of jump or branch"
Summary: VerifyError "Illegal target of jump or branch"
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 37247 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-04-29 05:26 EDT by Dani Megert CLA
Modified: 2003-06-05 09:34 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 Dani Megert CLA 2003-04-29 05:26:30 EDT
Build I20030422

Setup:
0) start dev workbench with I20030422
1) have JDT UI plug-in and JDT UI Refactoring tests as source
2) have I20030422 as binaries
3) rebuild all with 1.3 compliance level against 1.3.1 JRE
4) run "ExtractTempTests" as JUnit Plugin Test 

==> many verify errors "Illegal target of jump or branch" (see trace below)

The problem does not appear if R2.1 is used in step 0.


java.lang.VerifyError: (class:
org/eclipse/jdt/internal/corext/dom/fragments/ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory,
method: visit signature: (Lorg/eclipse/jdt/core/dom/InfixExpression;)Z) Illegal
target of jump or branch
	at
org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSubPartBySourceRange(ASTFragmentFactory.java:103)
	at
org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSourceRange(ASTFragmentFactory.java:81)
	at
org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.getSelectedExpression(ExtractTempRefactoring.java:685)
	at
org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkSelection(ExtractTempRefactoring.java:186)
	at
org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkActivation(ExtractTempRefactoring.java:176)
	at
org.eclipse.jdt.internal.corext.refactoring.base.Refactoring.checkPreconditions(Refactoring.java:76)
	at
org.eclipse.jdt.ui.tests.refactoring.RefactoringTest.performRefactoring(RefactoringTest.java:133)
	at
org.eclipse.jdt.ui.tests.refactoring.ExtractTempTests.failHelper1(ExtractTempTests.java:122)
	at
org.eclipse.jdt.ui.tests.refactoring.ExtractTempTests.testFail25(ExtractTempTests.java:550)
	at java.lang.reflect.Method.invoke(Native Method)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
	at
org.eclipse.pde.internal.junit.ui.RemotePluginTestRunner.main(RemotePluginTestRunner.java:30)
	at
org.eclipse.pde.internal.junit.ui.UITestApplication.runEventLoop(UITestApplication.java:35)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
	at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:431)
	at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
Comment 1 Philipe Mulet CLA 2003-04-29 05:31:10 EDT
Reproduced with simpler testcase:

public class X {

	Throwable ex;
	public static void main(String[] args) {
		new X().visit("hello world");
	}
	public boolean visit(Object node) {
		try {
			System.out.println(node);
		} catch (Throwable e) {
			ex = e;
		} finally {
			return false;
		}
	}
}


Problem got introduced since R2.1, when moving the natural exit in codegen of 
try-statement (to save one bytecode). The last catch block is branching too far 
if the subroutine doesn't complete normally.
Comment 2 Philipe Mulet CLA 2003-04-29 05:31:42 EDT
Fixed
Comment 3 Philipe Mulet CLA 2003-05-06 05:35:32 EDT
*** Bug 37247 has been marked as a duplicate of this bug. ***
Comment 4 David Audel CLA 2003-06-05 09:34:31 EDT
Verified.