From 03a4d2f0d47dfdce209de58f0530b17649c5b19b Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 20 Mar 2015 12:42:04 -0400 Subject: make sure LVTT names explicitly match the LVT names --- .../enigma/bytecode/LocalVariableRenamer.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java index 1179560a..215afc5a 100644 --- a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java +++ b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java @@ -35,12 +35,12 @@ public class LocalVariableRenamer { LocalVariableAttribute table = (LocalVariableAttribute)codeAttribute.getAttribute(LocalVariableAttribute.tag); if (table != null) { - renameTable(behaviorEntry, constants, table); + renameLVT(behaviorEntry, constants, table); } LocalVariableTypeAttribute typeTable = (LocalVariableTypeAttribute)codeAttribute.getAttribute(LocalVariableAttribute.typeTag); if (typeTable != null) { - renameTable(behaviorEntry, constants, typeTable); + renameLVTT(typeTable, table); } } } @@ -55,7 +55,7 @@ public class LocalVariableRenamer { } } - private void renameTable(BehaviorEntry behaviorEntry, ConstPool constants, LocalVariableAttribute table) { + private void renameLVT(BehaviorEntry behaviorEntry, ConstPool constants, LocalVariableAttribute table) { // skip empty tables if (table.tableLength() <= 0) { @@ -90,8 +90,24 @@ public class LocalVariableRenamer { } } + private void renameLVTT(LocalVariableTypeAttribute typeTable, LocalVariableAttribute table) { + // rename args to the same names as in the LVT + for (int i=0; i