ArrayIndexOutOfBoundsException at Frame.merge/MethodWriter.visitMaxs

Peter Veentjer <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Hi Guys,

I get an ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.objectweb.asm.Frame.merge(Frame.java:1373)
	at org.objectweb.asm.Frame.merge(Frame.java:1350)
	at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1275)
	at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:487)
	at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:412)
	at org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:275)
	at org.multiverse.stms.alpha.instrumentation.asm.AsmUtils.toBytecode(AsmUtils.java:472)
	at org.multiverse.stms.alpha.instrumentation.MultiverseJavaAgent$ImprovedAtomicMethodClassFileTransformer.doTransform(MultiverseJavaAgent.java:248)
	at org.multiverse.stms.alpha.instrumentation.asm.AbstractClassFileTransformer.transform(AbstractClassFileTransformer.java:62)
	at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

when I generate the byte[] from some ClassNode. I use the ClassWriter with:

 public static byte[] toBytecode(ClassNode classNode) {
        if (classNode == null) {
            throw new NullPointerException();
        }

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
        classNode.accept(cw);
        return cw.toByteArray();
    }

So since the COMPUTE_FRAMES is used, so I would expect that all the
frame configuration is done for me.

So what could be causing this problem? I have a hard time figuring out
what is going wrong based on this Exception
so it would be very helpful if someone could point me to the right
direction. Once I understand what is going wrong,
I believe I can fix it myself.
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.