Commit 3b06c225 authored by Eric Bruneton's avatar Eric Bruneton

Don't insert frames when expanding ASM pseudo instructions if EXPAND_FRAMES is not set.

ASM pseudo instructions are used when jump instructions need to be resized in large methods. To convert them to normal instructions, a new ClassReader->ClassWriter roundtrip is performed, with the EXPAND_ASM_INSNS flag and with the EXPAND_FRAMES flag if the class already had frames (see ClassWriter#toByteArray). If EXPAND_FRAMES is false this means the class had initially no frames, despite the fact that it has jump instructions (otherwise there could not be any ASM pseudo insns to replace). Therefore, in this case, we should not attempt to insert frames in ClassReader.
parent 256ab125
......@@ -1393,7 +1393,9 @@ public class ClassReader {
// insertFrame to true during the previous iteration. The actual
// frame content will be computed in MethodWriter.
if (insertFrame) {
mv.visitFrame(ClassWriter.F_INSERT, 0, null, 0, null);
if ((context.flags & EXPAND_FRAMES) != 0) {
mv.visitFrame(ClassWriter.F_INSERT, 0, null, 0, null);
}
insertFrame = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment