Recaf
Recaf copied to clipboard
Handle frame-generation with Java 7- classes with JSR/RET
Describe the bug
You can edit a class with JSR/RET but unless you disable
verifyin the config assembling/exporting these modified classes will complain.
Exception
java.lang.IllegalArgumentException: JSR/RET are not supported with computeFrames option
at org.objectweb.asm.Frame.execute(Frame.java:1017)
at org.objectweb.asm.MethodWriter.visitJumpInsn(MethodWriter.java:1145)
at org.objectweb.asm.tree.JumpInsnNode.accept(JumpInsnNode.java:79)
at org.objectweb.asm.tree.InsnList.accept(InsnList.java:144)
at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:751)
at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:649)
at org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:452)
at me.coley.recaf.ui.controls.text.BytecodeEditorPane.assemble(BytecodeEditorPane.java:230)
at me.coley.recaf.ui.controls.view.BytecodeViewport.save(BytecodeViewport.java:85)
Potential Fix
When loading older classes, pass them through JSRInlinerAdapter or disable frame generation.
If somebody can find a class/jar that demonstrates this behavior I can toss up a fix. I don't have one laying around at the moment.
afaik frames and jsr/ret are mutually exclusive, and jsr/ret was already deprecated by the time frames were introduced