Re: Re: Problem adding cloned instructions
Peter Veentjer <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Hi tronje, Thanks for your reply. What i find so confusing is that i have no problems when i use the tree api and create labels directly. But when these instructions are automatically created using cloning, i get the npe. So something is happening behind the screens and i would like to know what that is. On 7 nov 2009, at 11:35, Tronje Krop <[email protected]> wrote: > 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 > > -- > 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
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