When visitMaxs returns an ArrayIndexOutOfBoundsException, more information would be nice
I am generating random and what I think are valid methods using the MethodVisitor. When I use a
ClassWriter with COMPUTE_FRAMES and COMPUTE_MAXS, sometimes I run into a situation where
visitMaxs(0,0) throws an ArrayIndexOutOfBoundsException. I suspect that some of my generated
methods do not end up with 0 stack. I get something like this:
java.lang.ArrayIndexOutOfBoundsException: -1
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at org.objectweb.asm.util.TraceMethodVisitor.visitMaxs(Unknown Source)
at bugs.BugNode.generateMethod(BugNode.java:56)
I haven't found a way to print out the bytecodes that were visited. I tried TraceClassVisitor, but it doesn't
seem to print anything out as I use the MethodVisitor.
--Rob