Col-E / Col-E/Recaf

Handle frame-generation with Java 7- classes with JSR/RET

Open
#357 5 comments 1 reaction 0 assignees View on GitHub
bug enhancement
Dominant language
Java
Stars
7.4k
Forks
538
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

> You can edit a class with JSR/RET but unless you disable `verify` in 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](https://asm.ow2.io/javadoc/org/objectweb/asm/commons/JSRInlinerAdapter.html) or disable frame generation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.