2 Feb 09:26
Re: Frames computation with ClassWriter.getCommonSuperClass()
Clement Escoffier <clement.escoffier <at> gmail.com>
2012-02-02 08:26:27 GMT
2012-02-02 08:26:27 GMT
Hi, On 30.01.2012, at 22:01, Eugene Kuleshov wrote: > Clement, > > In your case, because you are introducing new variables and new > values on the stack, the visitFrame call will have to take into > account the current state of locals and stack. Normally you need to > pass EXPAND_FRAMES to the ClassReader.accept() call and then keep the > current state of locals and stack based on visitFrame() events > received by your own visitor and then merge it with your own added > locals and stack. > It's what I'm doing. > Naturally, when using any subclass of the LocalVariableSorter, you > should be calling super.visitXXX() method instead of mv.visitXXX(). > I'm using a GeneratorAdapter directly. So, no inheritance. > To get some more details about bytecode validity you can use > CheckClassAdapter, though it is not taking frames into the account, > but you can compare its output with your own expectations for those > frames. I'm using it (actually, the CheckClassAdapter is enabled automatically when running my tests (just to check). But as you said, it does not check the frames, so I always run into this Verifier error at runtime(Continue reading)
RSS Feed