use of net.runelite.asm.attributes.code.instructions.AThrow in project runelite by runelite.
the class IllegalStateExceptions method processOne.
private void processOne(InstructionContext ic) {
Instruction ins = ic.getInstruction();
Instructions instructions = ins.getInstructions();
if (instructions == null)
return;
List<Instruction> ilist = instructions.getInstructions();
JumpingInstruction jumpIns = (JumpingInstruction) ins;
assert jumpIns.getJumps().size() == 1;
Instruction to = jumpIns.getJumps().get(0);
// remove stack of if.
if (ins instanceof If) {
ic.removeStack(1);
}
ic.removeStack(0);
int i = ilist.indexOf(ins);
assert i != -1;
// remove up to athrow
while (!(ins instanceof AThrow)) {
instructions.remove(ins);
// don't need to ++i because
ins = ilist.get(i);
}
// remove athrow
instructions.remove(ins);
// insert goto
assert ilist.contains(to);
Goto g = new Goto(instructions, instructions.createLabelFor(to));
ilist.add(i, g);
++count;
}
Aggregations