Return a list of conditional statement exits with respect to a basic block.

        :param block_addr:  The address of the basic block.
        :return:            A list of statement IDs.
491249
def _conditional_exits(self, block_addr):
        

        vex_block = self.project.factory.block(block_addr).vex
        lst = [ ]

        for i, stmt in enumerate(vex_block.statements):
            if isinstance(stmt, pyvex.IRStmt.Exit):
                lst.append(i)

        return lst
476240
private void examineBasicBlocks() throws DataflowAnalysisException, CFGBuilderException {
        // Look for null check blocks where the reference being checked
        // is definitely null, or null on some path
        Iterator<BasicBlock> bbIter = invDataflow.getCFG().blockIterator();
        while (bbIter.hasNext()) {
            BasicBlock basicBlock = bbIter.next();

            if (basicBlock.isNullCheck()) {
                analyzeNullCheck(invDataflow, basicBlock);
            } else if (!basicBlock.isEmpty()) {
                // Look for all reference comparisons where
                // - both values compared are definitely null, or
                // - one value is definitely null and one is definitely not null
                // These cases are not null dereferences,
                // but they are quite likely to indicate an error, so while
                // we've got
                // information about null values, we may as well report them.
                InstructionHandle lastHandle = basicBlock.getLastInstruction();
                Instruction last = lastHandle.getInstruction();
                switch (last.getOpcode()) {
                case Const.IF_ACMPEQ:
                case Const.IF_ACMPNE:
                    analyzeRefComparisonBranch(basicBlock, lastHandle);
                    break;
                case Const.IFNULL:
                case Const.IFNONNULL:
                    analyzeIfNullBranch(basicBlock, lastHandle);
                    break;
                default:
                    break;
                }
            }
        }
    }
689573
def get_block_containing_tx(self, txid):
        
        blocks = list(backend.query.get_block_with_transaction(self.connection, txid))
        if len(blocks) > 1:
            logger.critical('Transaction id %s exists in multiple blocks', txid)

        return [block['height'] for block in blocks]
377469
def insert_basic_block(self, before, name=''):
        
        blk = Block(parent=self, name=name)
        self.blocks.insert(before, blk)
        return blk
828384
def program(self):
        
        statements = []
        if self.cur_token.type == TokenTypes.NEW_LINE:
            self.eat(TokenTypes.NEW_LINE)
        while self.cur_token.type != TokenTypes.EOF:
            statements += [self.statement()]
        return Block(statements)
216594
def _get_bb_addr_from_instr(self, instr):
        
        current_method = self.state.addr.method
        try:
            bb = current_method.block_by_label[instr]
        except KeyError:
            l.error("Possible jump to a non-existing bb %s --> %d",
                    self.state.addr, instr)
            raise IncorrectLocationException()

        return SootAddressDescriptor(current_method, bb.idx, 0)
363047
def rpc_get_consensus_hashes( self, block_id_list, **con_info ):
        
        if type(block_id_list) != list:
            return {'error': 'Invalid block heights', 'http_status': 400}

        if len(block_id_list) > 32:
            return {'error': 'Too many block heights', 'http_status': 400}

        for bid in block_id_list:
            if not check_block(bid):
                return {'error': 'Invalid block height', 'http_status': 400}

        db = get_db_state(self.working_dir)
        ret = {}
        for block_id in block_id_list:
            ret[block_id] = db.get_consensus_at(block_id)

        db.close()

        return self.success_response( {'consensus_hashes': ret} )
1209302
def _parse_block_ref(cls, block_ref, deprecated=False):
        

        if deprecated and block_ref is None:
            return None

        if isinstance(block_ref, LocalId):
            return block_ref

        is_valid_deprecated = deprecated and cls.DEPRECATED_ALLOWED_ID_RE.match(block_ref)
        is_valid = cls.ALLOWED_ID_RE.match(block_ref)

        if is_valid or is_valid_deprecated:
            return block_ref
        else:
            raise InvalidKeyError(cls, block_ref)
573688
def _pick_statement(self, block_address, stmt_idx):
        

        # TODO: Support context-sensitivity

        # Sanity check
        if not isinstance(block_address, int):
            raise AngrBackwardSlicingError("Invalid block address %s." % block_address)
        if not isinstance(stmt_idx, int):
            raise AngrBackwardSlicingError("Invalid statement ID %s." % stmt_idx)

        self.chosen_statements[block_address].add(stmt_idx)
570767
def get_catchup_block_ids(self, last_known_block_id):
        '''
        
        '''
        # If latest known block is not the current chain head, catch up
        catchup_up_blocks = []
        chain_head = self._block_store.chain_head
        if chain_head and last_known_block_id != chain_head.identifier:
            # Start from the chain head and get blocks until we reach the
            # known block
            for block in self._block_store.get_predecessor_iter():
                # All the blocks if NULL_BLOCK_IDENTIFIER
                if last_known_block_id != NULL_BLOCK_IDENTIFIER:
                    if block.identifier == last_known_block_id:
                        break
                catchup_up_blocks.append(block.identifier)

        return list(reversed(catchup_up_blocks))
234265
def get_block_statuses(self, block_ids):
        
        try:
            return [
                (block_id.hex(),
                 self._chain_controller.block_validation_result(
                     block_id.hex()))
                for block_id in block_ids
            ]
        except KeyError as key_error:
            raise UnknownBlock(key_error.args[0])
291424
def _addr(value):
    ''' 
    '''
    output = []

    try:
        indirect = False
        if value[0] == '*':
            indirect = True
            value = value[1:]

        value = int(value) & 0xFFFF
        if indirect:
            output.append('ld hl, (%s)' % str(value))
        else:
            output.append('ld hl, %s' % str(value))

    except ValueError:
        if value[0] == '_':
            output.append('ld hl, %s' % str(value))
            if indirect:
                output.append('ld c, (hl)')
                output.append('inc hl')
                output.append('ld h, (hl)')
                output.append('ld l, c')
        else:
            output.append('pop hl')
            if indirect:
                output.append('ld c, (hl)')
                output.append('inc hl')
                output.append('ld h, (hl)')
                output.append('ld l, c')

    output.append('call __ARRAY')
    REQUIRES.add('array.asm')

    return output
747202
public Collection<BasicBlock> getBlocksContainingInstructionWithOffset(int offset) {
        LinkedList<BasicBlock> result = new LinkedList<>();
        for (Iterator<BasicBlock> i = blockIterator(); i.hasNext();) {
            BasicBlock block = i.next();
            if (block.containsInstructionWithOffset(offset)) {
                result.add(block);
            }
        }
        return result;
    }
77617
def getBufferedFiles(self, block_id):
        
            
        try:
            conn = self.dbi.connection()
            result = self.buflist.execute(conn, block_id)
            return result
        finally:
            if conn:
                conn.close()
99035
def p_namedblock_statement(self, p):
        
        if isinstance(p[1], Decl):
            for r in p[1].list:
                if (not isinstance(r, Reg) and not isinstance(r, Wire)
                    and not isinstance(r, Integer) and not isinstance(r, Real)
                        and not isinstance(r, Parameter) and not isinstance(r, Localparam)):
                    raise ParseError("Syntax Error")
        p[0] = p[1]
        p.set_lineno(0, p.lineno(1))
497591
def block(self, *args, **kwargs):
        
        if not args and 'addr' not in kwargs:
            kwargs['addr'] = self.addr
        return self.project.factory.block(*args, backup_state=self, **kwargs)
1090219
def p_block_statements(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))