I get the expected ClassVerifyErrors when I try to load the class i generated using ASM. Upon further inspection, I see that jvm is correct and that the method indicates an invalid MAX_STACK value. It is strange that I use automatic stack counting and maximum local parameters, so this should not be a problem ... The method with an invalid parameter is very simple, and the result is bad bytecode.
I wrote a class with the intended method and compared my generated asm class with what javac was creating and bytecodes matching with the only error being the maximum stack, 0, which is wrong, while javac sets the value to 2.
I like it when I don't need to calculate max stack / locales.
source
share