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

Creating new class methods behaves wierdly #669

Open
C0D3-M4513R opened this issue Jun 6, 2023 · 1 comment
Open

Creating new class methods behaves wierdly #669

C0D3-M4513R opened this issue Jun 6, 2023 · 1 comment

Comments

@C0D3-M4513R
Copy link

C0D3-M4513R commented Jun 6, 2023

Open a .jar file, and then open a class within that jar.
Edit the assembly for a new method.
Try to create a new method, by prepending:

.method .private test ()V
A:
    aload this
    pop
    return
.end

This will give an error: Cannot resolve usage of 'this' to end label!
Now do the same, but postpend the method.
It "works" to save the assembly.
Close the assembly.

Now inspect the decompilation of that class, and try to find that method...
It will not be there.
Now open the assembly again: The newly created method has vanished into nothingness.

@C0D3-M4513R
Copy link
Author

Okay, so this might be partly also my fault:
If I use this code instead:

.method .private test ()V
A:
    aload this
    pop
    return
B:
.end

It does seem to work as intended.

But I still believe that saving shouldn't quietly fail like this.

@Col-E Col-E transferred this issue from Col-E/recaf-3x-issues Aug 30, 2023
@Col-E Col-E added the 3.X label Aug 30, 2023
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