Don't forget to replace un-deodexable instructions

git-svn-id: https://smali.googlecode.com/svn/trunk@671 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2010-03-06 06:12:03 +00:00
parent cf52e5cd48
commit cbc21d5ece

View File

@ -233,6 +233,32 @@ public class MethodAnalyzer {
} }
} while (true); } while (true);
for (int i=odexedInstructions.nextSetBit(0); i>=0; i=odexedInstructions.nextSetBit(i+1)) {
AnalyzedInstruction instruction = instructions.valueAt(i);
Instruction odexedInstruction = instruction.instruction;
int objectRegisterNumber;
if (odexedInstruction.getFormat() == Format.Format22cs) {
objectRegisterNumber = ((Instruction22cs)odexedInstruction).getRegisterB();
} else if (odexedInstruction.getFormat() == Format.Format35ms) {
objectRegisterNumber = ((Instruction35ms)odexedInstruction).getRegisterD();
} else if (odexedInstruction.getFormat() == Format.Format3rms) {
objectRegisterNumber = ((Instruction3rms)odexedInstruction).getStartRegister();
} else {
assert false;
throw new ExceptionWithContext(String.format("Unexpected format %s for odexed instruction",
odexedInstruction.getFormat().name()));
}
instruction.setDeodexedInstruction(new UnresolvedNullReference(odexedInstruction,
objectRegisterNumber));
setAndPropagateDeadness(instruction);
}
analyzerState = ANALYZED; analyzerState = ANALYZED;
} }