diff --git a/baksmali/src/main/java/org/jf/baksmali/Adaptors/MethodDefinition.java b/baksmali/src/main/java/org/jf/baksmali/Adaptors/MethodDefinition.java index 8e1f3900..a250eee2 100644 --- a/baksmali/src/main/java/org/jf/baksmali/Adaptors/MethodDefinition.java +++ b/baksmali/src/main/java/org/jf/baksmali/Adaptors/MethodDefinition.java @@ -42,6 +42,7 @@ import org.jf.dexlib.Debug.DebugInstructionIterator; import org.jf.dexlib.Util.AccessFlags; import org.antlr.stringtemplate.StringTemplateGroup; import org.antlr.stringtemplate.StringTemplate; +import org.jf.dexlib.Util.ExceptionWithContext; import org.jf.dexlib.Util.Hex; import org.jf.dexlib.Util.SparseIntArray; @@ -61,42 +62,49 @@ public class MethodDefinition { private final int registerCount; public MethodDefinition(StringTemplateGroup stg, ClassDataItem.EncodedMethod encodedMethod) { - this.stg = stg; - this.encodedMethod = encodedMethod; - //TODO: what about try/catch blocks inside the dead code? those will need to be commented out too. ugh. - if (encodedMethod.codeItem != null) { - methodAnalyzer = new MethodAnalyzer(encodedMethod, baksmali.deodex); - List instructions = methodAnalyzer.getInstructions(); + try { + this.stg = stg; + this.encodedMethod = encodedMethod; - packedSwitchMap = new SparseIntArray(1); - sparseSwitchMap = new SparseIntArray(1); - instructionMap = new SparseIntArray(instructions.size()); + //TODO: what about try/catch blocks inside the dead code? those will need to be commented out too. ugh. - registerCount = encodedMethod.codeItem.getRegisterCount(); + if (encodedMethod.codeItem != null) { + methodAnalyzer = new MethodAnalyzer(encodedMethod, baksmali.deodex); + List instructions = methodAnalyzer.getInstructions(); - int currentCodeAddress = 0; - for (int i=0; i