fix an issue reading the string index for indexes >16bits, for the const-string/jumbo opcode

git-svn-id: https://smali.googlecode.com/svn/trunk@495 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-12-09 09:56:13 +00:00
parent 8fc44f0bbc
commit b6ce091ae3
2 changed files with 9 additions and 1 deletions

View File

@ -54,6 +54,10 @@ public class Instruction31c extends InstructionWithReference implements SingleRe
super(dexFile, opcode, buffer, bufferIndex); super(dexFile, opcode, buffer, bufferIndex);
} }
protected int getReferencedItemIndex() {
return NumberUtils.decodeInt(buffer, bufferIndex + 2);
}
public Format getFormat() { public Format getFormat() {
return Format.Format31c; return Format.Format31c;
} }

View File

@ -43,10 +43,14 @@ public abstract class InstructionWithReference extends Instruction {
protected InstructionWithReference(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) { protected InstructionWithReference(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) {
super(opcode, buffer, bufferIndex); super(opcode, buffer, bufferIndex);
int itemIndex = NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2); int itemIndex = getReferencedItemIndex();
lookupReferencedItem(dexFile, opcode, itemIndex); lookupReferencedItem(dexFile, opcode, itemIndex);
} }
protected int getReferencedItemIndex() {
return NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
}
public Item getReferencedItem() { public Item getReferencedItem() {
return referencedItem; return referencedItem;
} }