-
Notifications
You must be signed in to change notification settings - Fork 516
Closed
Labels
Description
While opening the code in Assembler shows me ALOAD 0 instead of ALOAD THIS, and after saving this code the decompiler gets weird, but on runtime this seems to work.
Example:
Function in assembler:
ALOAD 0 FLOAD 1 INVOKEVIRTUAL com/desertkun/brainout/AuX/aux/jh.setX(F)V ALOAD 0 FLOAD 2 INVOKEVIRTUAL com/desertkun/brainout/AuX/aux/jh.setY(F)V RETURN
Function in decompiler:
public void setPosition(float f2, float f3) { this.setX(f2); this.setY(f3); }
Function after saving:
public void setPosition(float f2, float f3) { jh jh2; jh2.setX(f2); jh2.setY(f3); }
To Reproduce
Steps to reproduce the behavior:
- Open any function that uses 'this'
- Open it in assembler
- (You can just press space at the end of file) change something
- Save and decompile
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
Col-E commentedon Jun 17, 2019
If
ALOAD 0is being emitted, then the local variable debug table does not have the name for the 0th variable set tothis. However since this is a common case I'll add a condition to make surethisis used.Note:
ALOAD 0andALOAD this(thisis all lower-case) are the same if the method is not static.Note: When sharing multi-line code snippets you can use the following for better formatting: (Remove that first
\shown below)Col-E commentedon Jun 17, 2019
Labeling
enhancementfor since this behavior of0vsthisisn't a bug.Labeling
bugbecause of the wrong decompilation, which is likely caused by the fact that the assembler isn't properly regenerating the type ofthisin the local variable table after the assembly is saved.