[jboss-jira] [JBoss JIRA] Created: (JASSIST-79) Editing MethodCall produces incorrect byte code | java.lang.VerifyError: Illegal target of jump or branch | goto points to invalid instruction

Martin Burger (JIRA) jira-events at lists.jboss.org
Thu Apr 16 06:13:25 EDT 2009


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


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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list