ArrayOutOfBoundsException in ClassReader.readFrameType()
I am using a tool (jar2xml) that is built on top of ASM.
I am experiencing an ArrayOutOfBoundsException in this method -
ClassReader.readFrameType() when parsing a JAR using the tool (internally reads
all classes from jar using a ClassReader).
I am using ASM latest available version (5.0.1).
the issue is that the following code:
int n = readUnsignedShort(stackMap); // line 2083
initializes the number of locals in the method, however somehow in this
scenario the number is 7, whereas the correct number is 6 (as seen by javap
output -- attached to this case).
1. How can i further diagnose this case?
2. Is this a bug in ASM? a faulty .class file?
Attaching the javap output + the .class file.
Also, here's the stack trace (right before the exception):
main@1, prio=5, in group 'main', status: 'RUNNING'
at org.objectweb.asm.ClassReader.readFrameType(ClassReader.java:2152)
at org.objectweb.asm.ClassReader.readFrame(ClassReader.java:2090)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1309)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
at jar2xml.JavaArchive.getPackages(JavaArchive.java:81)
at jar2xml.JavaArchive.getPackages(JavaArchive.java:62)
at jar2xml.Start.main(Start.java:122)