Re: NPE in FrameNode

Eric Bruneton <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
melix wrote:
> Hi,
> 
> I'm new to ASM, so there must be many things I'm missing. I'm trying to
> replace a method with another. I've written code for the new method, and
> looked at the bytecode outline to see what's generated for it. At the end of
> the method, I can see the following :
> 
>  L9
>     LINENUMBER 227 L9
>    FRAME CHOP 1
>     ICONST_0
>     IRETURN
> 
> This actually gets converted to the following ASM code :
> 
> mv.visitLabel(l9);
> mv.visitLineNumber(227, l9);
> mv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);
> mv.visitInsn(ICONST_0);
> mv.visitInsn(IRETURN);
> 
> However, if I use a MethodNode as the method visitor, then the following
> exception is thrown :
> 
> Exception in thread "main" java.lang.NullPointerException
> 	at java.util.Arrays$ArrayList.<init>(Arrays.java:3357)
> 	at java.util.Arrays.asList(Arrays.java:3343)
> 	at org.objectweb.asm.tree.FrameNode.asList(Unknown Source)
> 	at org.objectweb.asm.tree.FrameNode.<init>(Unknown Source)
> 	at org.objectweb.asm.tree.MethodNode.visitFrame(Unknown Source)
> 
> Is it a bug in ASM (FrameNode ? MethodNode ?), in ASMifier, or in my own
> code ? Is there any workaround ?

It was indeed a bug in FrameNode, I fixed it in SVN.

Eric
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.