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

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

    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. pom.xml
          4 kB
          Alexandre Chatiron
        2. javaflow-asm5.02.patch
          13 kB
          Alexandre Chatiron
        3. ContinuationMethodAnalyzer.java
          13 kB
          Alexandre Chatiron
        4. ContinuationMethodAdapter.java
          15 kB
          Alexandre Chatiron
        5. ContinuationClassAdapter.java
          3 kB
          Alexandre Chatiron
        6. BytecodeClassLoader.java
          2 kB
          Alexandre Chatiron

        Activity

          People

            Unassigned Unassigned
            AlexChatiron Alexandre Chatiron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: