LocalVariablesSorter incorrectly assumes it can call visitFrame() with original args
See the full code for this test case here: https://github.com/pmahoney/asm-bug
I am using OpenJDK7 and ASM 4.1. All tests were run using OpenJDK 7.
The test program instruments Example.class which contains one simple method
containing an exception handler. MyMethodVisitor attempts to add an int local
variable at the method start, and then print it out prior to method return.
LocalVariablesSorter#visitFrame() bails out by calling super.visitFrame() with
the original args because "changed" is false. But this produces an incorrect
stack map frame without my new local variable.
Forcing this "changed" variable to "true" (via reflection) results in the
correct stack map frame.
I only see the Java verifier complain when I write out the modified class and
attempt to run it like "java Example". That is, when I load the class through
my own ClassLoader, I do not see any VerifyError from the JVM. (I do not
understand the reason for this.)