Re: Problem adding cloned instructions

Tronje Krop <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Organization Darmstadt University of Technology
Message-ID <[email protected]>
Hi Peter,

> I'm encountering a problem (npe) while writing a class using the  
> classwriter with compute_frames option.
> 
> What i'm doing is rewriting a method by inserting cloned instructions  
> where labels and labelnodes are also completely cloned (so no  
> sharing). The big problem is that classwriter executed the visitmaxs  
> and this relies  on the frame of the cloned label and this frame is  
> null, so causing an npe
> 
> So appearently i'm doing something wrong. Are there any special rules  
> how to clone a label / labelnode?

I think you should try CheckClassAdapter in your rewriting pass
to verify whether your produced bytecode is correct. That at least
was the hint helped me last time getting an NPE in ClassWriter.

I actually included the CheckClassAdapter in every debugging run
afterwards when running in develop-mode to have more verbose output
of errors. If this does not help to catch the error you should re-
visit the code by TraceClassVisitor. Last time debugging, I had the
feeling CheckClassAdapter does not catch every problem adequately,
but may although have been my problem.

CU Tronje
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.