/** * 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); }
/** * 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 >= 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); }
/** * 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 >= 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 >= 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); }
/** * Builds a BitSet of block indices from a basic block list and a list * of labels taken from Rop form. * * @param blocks Rop blocks * @param labelList list of rop block labels * @return BitSet of block indices */ static BitSet bitSetFromLabelList(BasicBlockList blocks, IntList labelList) { BitSet result = new BitSet(blocks.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.set(blocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds a BitSet of block indices from a basic block list and a list * of labels taken from Rop form. * * @param blocks Rop blocks * @param labelList list of rop block labels * @return BitSet of block indices */ static BitSet bitSetFromLabelList(BasicBlockList blocks, IntList labelList) { BitSet result = new BitSet(blocks.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.set(blocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds a BitSet of block indices from a basic block list and a list * of labels taken from Rop form. * * @param blocks Rop blocks * @param labelList list of rop block labels * @return BitSet of block indices */ static BitSet bitSetFromLabelList(BasicBlockList blocks, IntList labelList) { BitSet result = new BitSet(blocks.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.set(blocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds a BitSet of block indices from a basic block list and a list * of labels taken from Rop form. * * @param blocks Rop blocks * @param labelList list of rop block labels * @return BitSet of block indices */ static BitSet bitSetFromLabelList(BasicBlockList blocks, IntList labelList) { BitSet result = new BitSet(blocks.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.set(blocks.indexOfLabel(labelList.get(i))); } return result; }
private void convertRopToSsaBlocks(RopMethod rmeth) { BasicBlockList ropBlocks = rmeth.getBlocks(); int sz = ropBlocks.size(); blocks = new ArrayList<SsaBasicBlock>(sz + 2); for (int i = 0; i < sz; i++) { SsaBasicBlock sbb = SsaBasicBlock.newFromRop(rmeth, i, this); blocks.add(sbb); } // Add an no-op entry block. int origEntryBlockIndex = rmeth.getBlocks() .indexOfLabel(rmeth.getFirstLabel()); SsaBasicBlock entryBlock = blocks.get(origEntryBlockIndex).insertNewPredecessor(); entryBlockIndex = entryBlock.getIndex(); exitBlockIndex = -1; // This gets made later. }
private void convertRopToSsaBlocks(RopMethod rmeth) { BasicBlockList ropBlocks = rmeth.getBlocks(); int sz = ropBlocks.size(); blocks = new ArrayList<SsaBasicBlock>(sz + 2); for (int i = 0; i < sz; i++) { SsaBasicBlock sbb = SsaBasicBlock.newFromRop(rmeth, i, this); blocks.add(sbb); } // Add an no-op entry block. int origEntryBlockIndex = rmeth.getBlocks() .indexOfLabel(rmeth.getFirstLabel()); SsaBasicBlock entryBlock = blocks.get(origEntryBlockIndex).insertNewPredecessor(); entryBlockIndex = entryBlock.getIndex(); exitBlockIndex = -1; // This gets made later. }
private void convertRopToSsaBlocks(RopMethod rmeth) { BasicBlockList ropBlocks = rmeth.getBlocks(); int sz = ropBlocks.size(); blocks = new ArrayList<SsaBasicBlock>(sz + 2); for (int i = 0; i < sz; i++) { SsaBasicBlock sbb = SsaBasicBlock.newFromRop(rmeth, i, this); blocks.add(sbb); } // Add an no-op entry block. int origEntryBlockIndex = rmeth.getBlocks() .indexOfLabel(rmeth.getFirstLabel()); SsaBasicBlock entryBlock = blocks.get(origEntryBlockIndex).insertNewPredecessor(); entryBlockIndex = entryBlock.getIndex(); exitBlockIndex = -1; // This gets made later. }
private void convertRopToSsaBlocks(RopMethod rmeth) { BasicBlockList ropBlocks = rmeth.getBlocks(); int sz = ropBlocks.size(); blocks = new ArrayList<SsaBasicBlock>(sz + 2); for (int i = 0; i < sz; i++) { SsaBasicBlock sbb = SsaBasicBlock.newFromRop(rmeth, i, this); blocks.add(sbb); } // Add an no-op entry block. int origEntryBlockIndex = rmeth.getBlocks() .indexOfLabel(rmeth.getFirstLabel()); SsaBasicBlock entryBlock = blocks.get(origEntryBlockIndex).insertNewPredecessor(); entryBlockIndex = entryBlock.getIndex(); exitBlockIndex = -1; // This gets made later. }
private void convertRopToSsaBlocks(RopMethod rmeth) { BasicBlockList ropBlocks = rmeth.getBlocks(); int sz = ropBlocks.size(); blocks = new ArrayList<SsaBasicBlock>(sz + 2); for (int i = 0; i < sz; i++) { SsaBasicBlock sbb = SsaBasicBlock.newFromRop(rmeth, i, this); blocks.add(sbb); } // Add an no-op entry block. int origEntryBlockIndex = rmeth.getBlocks() .indexOfLabel(rmeth.getFirstLabel()); SsaBasicBlock entryBlock = blocks.get(origEntryBlockIndex).insertNewPredecessor(); entryBlockIndex = entryBlock.getIndex(); exitBlockIndex = -1; // This gets made later. }
/** * Builds an IntList of block indices from a basic block list and a list * of labels taken from Rop form. * * @param ropBlocks Rop blocks * @param labelList list of rop block labels * @return IntList of block indices */ public static IntList indexListFromLabelList(BasicBlockList ropBlocks, IntList labelList) { IntList result = new IntList(labelList.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.add(ropBlocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds an IntList of block indices from a basic block list and a list * of labels taken from Rop form. * * @param ropBlocks Rop blocks * @param labelList list of rop block labels * @return IntList of block indices */ public static IntList indexListFromLabelList(BasicBlockList ropBlocks, IntList labelList) { IntList result = new IntList(labelList.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.add(ropBlocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds an IntList of block indices from a basic block list and a list * of labels taken from Rop form. * * @param ropBlocks Rop blocks * @param labelList list of rop block labels * @return IntList of block indices */ public static IntList indexListFromLabelList(BasicBlockList ropBlocks, IntList labelList) { IntList result = new IntList(labelList.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.add(ropBlocks.indexOfLabel(labelList.get(i))); } return result; }
/** * Builds an IntList of block indices from a basic block list and a list * of labels taken from Rop form. * * @param ropBlocks Rop blocks * @param labelList list of rop block labels * @return IntList of block indices */ public static IntList indexListFromLabelList(BasicBlockList ropBlocks, IntList labelList) { IntList result = new IntList(labelList.size()); for (int i = 0, sz = labelList.size(); i < sz; i++) { result.add(ropBlocks.indexOfLabel(labelList.get(i))); } return result; }