/** * Gets the first block in the list with the given label, if any. * * @param label {@code >= 0;} the label to look for * @return {@code non-null;} the so-labelled block * @throws IllegalArgumentException thrown if the label isn't found */ public BasicBlock labelToBlock(int label) { int idx = indexOfLabel(label); if (idx < 0) { throw new IllegalArgumentException("no such label: " + Hex.u2(label)); } return get(idx); }
/** * Gets the first block in the list with the given label, if any. * * @param label {@code label >= 0;} the label to look for * @return {@code non-null;} the so-labelled block * @throws IllegalArgumentException thrown if the label isn't found */ public BasicBlock labelToBlock(int label) { int idx = indexOfLabel(label); if (idx < 0) { throw new IllegalArgumentException("no such label: " + Hex.u2(label)); } return get(idx); }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** * Visits each instruction of each block in the list, in order. * * @param visitor {@code non-null;} visitor to use */ public void forEachInsn(Insn.Visitor visitor) { int sz = size(); for (int i = 0; i < sz; i++) { BasicBlock one = get(i); InsnList insns = one.getInsns(); insns.forEach(visitor); } }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ @Override public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** {@inheritDoc} */ @Override public boolean hasAnyCatches() { BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); if (catches.size() != 0) { return true; } } return false; }
/** * Sets up the address arrays. */ private void setupArrays(RopMethod method) { BasicBlockList blocks = method.getBlocks(); int sz = blocks.size(); for (int i = 0; i < sz; i++) { BasicBlock one = blocks.get(i); int label = one.getLabel(); Insn insn = one.getInsns().get(0); starts[label] = new CodeAddress(insn.getPosition()); SourcePosition pos = one.getLastInsn().getPosition(); lasts[label] = new CodeAddress(pos); ends[label] = new CodeAddress(pos); } } }