Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Creating new class methods behaves wierdly

Open C0D3-M4513R opened this issue 2 years ago • 1 comments

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 avatar Jun 06 '23 22:06 C0D3-M4513R

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.

C0D3-M4513R avatar Jun 06 '23 22:06 C0D3-M4513R

Closing as this has since been resolved in 4.X

Col-E avatar Jul 07 '24 07:07 Col-E