Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Col-E opened this issue Feb 23, 2021 · 2 comments
Open

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

Col-E opened this issue Feb 23, 2021 · 2 comments

Comments

@Col-E
Copy link
Owner

Col-E commented Feb 23, 2021

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 or disable frame generation.

@Col-E
Copy link
Owner Author

Col-E commented Apr 10, 2021

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.

@GiantNuker
Copy link

afaik frames and jsr/ret are mutually exclusive, and jsr/ret was already deprecated by the time frames were introduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants