]
Shigeru Chiba resolved JASSIST-79.
----------------------------------
Resolution: Done
Fix Version/s: 3.11.0.GA
Editing MethodCall produces incorrect byte code |
java.lang.VerifyError: Illegal target of jump or branch | goto points to invalid
instruction
----------------------------------------------------------------------------------------------------------------------------------------------
Key: JASSIST-79
URL:
https://jira.jboss.org/jira/browse/JASSIST-79
Project: Javassist
Issue Type: Bug
Affects Versions: 3.10.0.GA
Environment: $ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)
Reporter: Martin Burger
Assignee: Shigeru Chiba
Fix For: 3.11.0.GA
Attachments: jinsi-jassist-79.tgz, Parser.instrumented.class,
Parser.instrumented.dump, Parser.original.class, Parser.original.dump,
Parser.original.jad, Parser.original.java
I instrument method calls in a class called org.mozilla.javascript.Parser.
If I run (or, load) this class, a java.lang.VerifyError will be thrown:
Exception in thread "main" java.lang.VerifyError: (class:
org/mozilla/javascript/Parser, method: statementHelper signature:
(Lorg/mozilla/javascript/TokenStream;)Ljava/lang/Object;) Illegal target of jump or
branch
It seems Javassist introduces a defective goto statement at position 3200 in method
statementHelper:
3200: goto -29495
Obviously, offset -29495 is an invalid opcode address.
The corresponding Java code (excerpt):
switch(tt) {
case TokenStream.IF: {
skipsemi = true;
sourceAdd((char)ts.IF);
int lineno = ts.getLineno();
Object cond = condition(ts);
sourceAdd((char)ts.LC);
sourceAdd((char)ts.EOL);
Object ifTrue = statement(ts);
Object ifFalse = null;
if (ts.matchToken(ts.ELSE)) {
sourceAdd((char)ts.RC);
sourceAdd((char)ts.ELSE);
sourceAdd((char)ts.LC);
sourceAdd((char)ts.EOL);
ifFalse = statement(ts);
}
sourceAdd((char)ts.RC);
sourceAdd((char)ts.EOL);
pn = nf.createIf(cond, ifTrue, ifFalse, lineno);
break;
}
case TokenStream.SWITCH: {
I think the break statement is related to this defect.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: