Bug 26129 - JACKS: VerifyError, because opcode jsr_w not used
Summary: JACKS: VerifyError, because opcode jsr_w not used
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-13 12:08 EST by Olivier Thomann CLA
Modified: 2002-12-17 10:15 EST (History)
1 user (show)

See Also:


Attachments
Test case (99.49 KB, text/plain)
2002-11-13 12:09 EST, Olivier Thomann CLA
no flags Details
Fix for this problem (2.63 KB, patch)
2002-11-13 12:30 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2002-11-13 12:08:55 EST
Using 1112, compile the following test case (see attached file) and run it.
You will get:
java.lang.VerifyError: (class: A, method: main signature:
([Ljava/lang/String;)V) Illegal target of jump or branch
Exception in thread "main" 

The opcode jsr_w should be used instead of jsr.
Comment 1 Olivier Thomann CLA 2002-11-13 12:09:33 EST
Created attachment 2399 [details]
Test case

Compile this code.
Comment 2 Olivier Thomann CLA 2002-11-13 12:30:10 EST
Created attachment 2400 [details]
Fix for this problem

Fix proposal.
Comment 3 Olivier Thomann CLA 2002-11-13 12:31:01 EST
Need further testing, but it should work quite well. I used the same approach
than for goto_w.
Comment 4 Philipe Mulet CLA 2002-11-14 08:56:06 EST
Do we need the extra method ? Isn't there a simpler way to just target the 
field ?
Comment 5 Olivier Thomann CLA 2002-11-14 09:00:41 EST
I wanted to keep the code in a method, but we can inline it if necessary. We 
should realize that this almost never happen. Only in compiler tests :-), so we 
don't need to "optimize" such a case.
Comment 6 Olivier Thomann CLA 2002-11-14 12:05:58 EST
Change summary.
Comment 7 Olivier Thomann CLA 2002-11-18 10:29:15 EST
Fixed and released in 2.1 stream.
Regression test added.
Comment 8 David Audel CLA 2002-12-17 10:15:05 EST
Verified.