public static BasicBlock find(BasicBlock[] blocks, int pos)
        throws BadBytecode
    {
        for (int i = 0; i < blocks.length; i++) {
            int iPos = blocks[i].position;
            if (iPos <= pos && pos < iPos + blocks[i].length)
                return blocks[i];
        }

        throw new BadBytecode("no basic block at " + pos);
    }