if (insn instanceof InvokeInstruction) {
InvokeInstruction invoke = (InvokeInstruction)insn;
if (invoke.getType() != InvocationType.VIRTUAL) {
continue;
}
NullCheckInstruction nullCheck = new NullCheckInstruction();
nullCheck.setValue(invoke.getInstance());
Variable var = block.getProgram().createVariable();
nullCheck.setReceiver(var);
invoke.setInstance(var);
block.getInstructions().add(i++, nullCheck);
}
}
}