Skip to content

Commit

Permalink
fix: Force slot 0 in virtual methods to always be 'this'
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Nov 3, 2024
1 parent 3608d61 commit 9a413ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public void setLabelPrefix(String labelPrefix) {
for (Local local : code.localVariables()) {
// Transform local name to be legal
int index = local.index();
String baseName = local.name();
String name = escapeName(baseName, index, isStatic);
boolean isThis = !isStatic && index == 0;
String baseName = isThis ? "this" : local.name();
String name = isThis ? "this" : escapeName(baseName, index, isStatic);
String descriptor = local.type().descriptor();
Type varType = Types.typeFromDescriptor(descriptor);
boolean escaped = !baseName.equals(name);
Expand Down

0 comments on commit 9a413ea

Please sign in to comment.