diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21c.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21c.java index 20c4fa64..bec647fe 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21c.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21c.java @@ -69,6 +69,10 @@ public class Instruction21c extends InstructionWithReference implements SingleRe } protected void writeInstruction(AnnotatedOutput out, int currentCodeOffset) { + if(opcode == Opcode.CONST_STRING && getReferencedItem().getIndex() > 0xFFFF) { + throw new RuntimeException("String offset is too large for const-string. Use string-const/jumbo instead."); + } + out.writeByte(opcode.value); out.writeByte(regA); out.writeShort(getReferencedItem().getIndex());