Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-476

[asm] IllegalStateException: "Undefined label used" with ASM > 4.1

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Nightly Builds
    • None
    • Javaflow

    Description

      I want to upgrade Commons Javaflow from ASM 4 to 5 (same problem with 4.1 ) and I get this exception:

      java.lang.IllegalStateException: Undefined label used
              at org.objectweb.asm.util.CheckMethodAdapter.visitMaxs(Unknown Source)
              at
      org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAdapter.visitMaxs(ContinuationMethodAdapter.java:313)
              at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
              at
      org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:140)
      

      the code triggering this error is:

          public void visitMaxs(int maxStack, int maxLocals) {
              Label endLabel = new Label();
              mv.visitLabel(endLabel);
      
              mv.visitLocalVariable("__stackRecorder", "L" + STACK_RECORDER + ";", null, startLabel, endLabel, stackRecorderVar);
      
              mv.visitMaxs(0, 0);
          }
      

      Any idea how to fix that?

      Attachments

        1. BytecodeClassLoader.java
          2 kB
          Alexandre Chatiron
        2. ContinuationClassAdapter.java
          3 kB
          Alexandre Chatiron
        3. ContinuationMethodAdapter.java
          15 kB
          Alexandre Chatiron
        4. ContinuationMethodAnalyzer.java
          13 kB
          Alexandre Chatiron
        5. javaflow-asm5.02.patch
          13 kB
          Alexandre Chatiron
        6. pom.xml
          4 kB
          Alexandre Chatiron

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            AlexChatiron Alexandre Chatiron

            Dates

              Created:
              Updated:

              Slack

                Issue deployment