[jboss-jira] [JBoss JIRA] Updated: (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 07:24:22 EDT 2009


     [ https://jira.jboss.org/jira/browse/JASSIST-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Burger updated JASSIST-79:
---------------------------------

    Attachment: Parser.original.class
                Parser.original.dump
                Parser.original.java


Original (not instrumented) files:

Parser.original.class - class file as compiled by javac
Parser.original.dump - decompiled dump obtained by calling javap
Parser.original.java - original source file

> 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
>         Attachments: Parser.original.class, Parser.original.dump, 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: 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