IllegalStateException:"使用的未定义标签" ASM> 4.1

时间:2014-05-05 03:32:53

标签: java illegalstateexception java-bytecode-asm

我想将Commons Javaflow从ASM 4升级到5(与4.1相同的问题),我得到了这个例外:

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)

触发此错误的代码是:

   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);
  }

知道如何解决这个问题吗?

0 个答案:

没有答案