diff options
Diffstat (limited to 'src/cuchaz/enigma/bytecode/LocalVariableRenamer.java')
| -rw-r--r-- | src/cuchaz/enigma/bytecode/LocalVariableRenamer.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java index 53f207c..c87c25b 100644 --- a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java +++ b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java | |||
| @@ -3,6 +3,7 @@ package cuchaz.enigma.bytecode; | |||
| 3 | import javassist.CtBehavior; | 3 | import javassist.CtBehavior; |
| 4 | import javassist.CtClass; | 4 | import javassist.CtClass; |
| 5 | import javassist.bytecode.ByteArray; | 5 | import javassist.bytecode.ByteArray; |
| 6 | import javassist.bytecode.CodeAttribute; | ||
| 6 | import javassist.bytecode.ConstPool; | 7 | import javassist.bytecode.ConstPool; |
| 7 | import javassist.bytecode.LocalVariableAttribute; | 8 | import javassist.bytecode.LocalVariableAttribute; |
| 8 | 9 | ||
| @@ -13,7 +14,11 @@ public class LocalVariableRenamer { | |||
| 13 | for (CtBehavior behavior : c.getDeclaredBehaviors()) { | 14 | for (CtBehavior behavior : c.getDeclaredBehaviors()) { |
| 14 | 15 | ||
| 15 | // if there's a local variable table, just rename everything to v1, v2, v3, ... for now | 16 | // if there's a local variable table, just rename everything to v1, v2, v3, ... for now |
| 16 | LocalVariableAttribute table = (LocalVariableAttribute)behavior.getMethodInfo().getCodeAttribute().getAttribute(LocalVariableAttribute.tag); | 17 | CodeAttribute codeAttribute = behavior.getMethodInfo().getCodeAttribute(); |
| 18 | if (codeAttribute == null) { | ||
| 19 | continue; | ||
| 20 | } | ||
| 21 | LocalVariableAttribute table = (LocalVariableAttribute)codeAttribute.getAttribute(LocalVariableAttribute.tag); | ||
| 17 | if (table == null) { | 22 | if (table == null) { |
| 18 | continue; | 23 | continue; |
| 19 | } | 24 | } |