Community
Participate
Working Groups
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.
Created attachment 2399 [details] Test case Compile this code.
Created attachment 2400 [details] Fix for this problem Fix proposal.
Need further testing, but it should work quite well. I used the same approach than for goto_w.
Do we need the extra method ? Isn't there a simpler way to just target the field ?
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.
Change summary.
Fixed and released in 2.1 stream. Regression test added.
Verified.