-
1. Re: ldc operand is null
chiba Dec 15, 2005 5:38 AM (in response to klagesb5)How did you modify your method with Javassist?
It might be a bug.
Chiba -
2. Re: ldc operand is null
klagesb5 Dec 15, 2005 6:38 AM (in response to klagesb5)Well strangely I didn't actually modify this method, but I have added methods to the class and increased the size of the constant pool enough to make the ldc change to an ldc_w.
Having taken a look at the code and debuged my classes I can see it finding the ldc and creating linked list of the final class LdcEntry. It then iterates through each of these (only two in my case), inserts a gap, and then places the ldc_w opcode plus the 16 bit index. It looks like the insertGap2 method in codeIterator is inserting one NOP opcode but then copying the old ldc opcode into the new code before carrying on with the invokevirtual - if you see what I mean. I don't know if this is right? It seems to produce the byte codes that I have shown, which the preverifier is complaining about. Should it not place enough NOP opcodes and then carry on copying the code from the invoke virtual?
Cheers for the help. -
3. Re: ldc operand is null
klagesb5 Dec 15, 2005 9:09 AM (in response to klagesb5)I have found even more. The problem seems to stem from the fact that insertGap in codeIterator doesn't nescessarily insert a gap of the gapLength but will insert a gap of gapLength + 3 if an alignment expcetion is thrown. An alignment exception is thrown because my code has a switch statement in it. Thus when the original code would have been overwritten it is not because there is a gap of 4 rather than 1.
Hope this helps.
Ben -
4. Re: ldc operand is null
flonou Jul 17, 2007 11:07 AM (in response to klagesb5)Hello,
I'm having a similar problem. Has this issue been solved??
Thanks