# Buggy code
def _indirect_jump_encountered(
    self, addr, cfg_node, irsb, func_addr, stmt_idx=DEFAULT_STATEMENT
):
    """
    Called when we encounter an indirect jump. We will try to resolve this indirect jump using timeless (fast)
    indirect jump resolvers. If it cannot be resolved, we will see if this indirect jump has been resolved before.

    :param int addr:                Address of the block containing the indirect jump.
    :param cfg_node:                The CFGNode instance of the block that contains the indirect jump.
    :param pyvex.IRSB irsb:         The IRSB instance of the block that contains the indirect jump.
    :param int func_addr:           Address of the current function.
    :param int or str stmt_idx:     ID of the source statement.

    :return:    A 3-tuple of (whether it is resolved or not, all resolved targets, an IndirectJump object
                if there is one or None otherwise)
    :rtype:     tuple
    """

    jumpkind = irsb.jumpkind
    l.debug("IRSB %#x has an indirect jump (%s) as its default exit.", addr, jumpkind)

    # try resolving it fast
    resolved, resolved_targets = self._resolve_indirect_jump_timelessly(
        addr, irsb, func_addr, jumpkind
    )
    if resolved:
        l.debug(
            "Indirect jump at block %#x is resolved by a timeless indirect jump resolver. "
            "%d targets found.",
            addr,
            len(resolved_targets),
        )
        return True, resolved_targets, None

    l.debug(
        "Indirect jump at block %#x cannot be resolved by a timeless indirect jump resolver.",
        addr,
    )

    # Add it to our set. Will process it later if user allows.
    # Create an IndirectJump instance
    if addr not in self.indirect_jumps:
        if self.project.arch.branch_delay_slot:
            if len(cfg_node.instruction_addrs) < 2:
                # sanity check
                # decoding failed when decoding the second instruction (or even the first instruction)
                return False, [], None
            ins_addr = cfg_node.instruction_addrs[-2]
        else:
            ins_addr = cfg_node.instruction_addrs[-1]
        ij = IndirectJump(
            addr, ins_addr, func_addr, jumpkind, stmt_idx, resolved_targets=[]
        )
        self.indirect_jumps[addr] = ij
        resolved = False
    else:
        ij = self.indirect_jumps[addr]  # type: IndirectJump
        resolved = len(ij.resolved_targets) > 0

    return resolved, ij.resolved_targets, ij


# Traceback (IndexError)
import angr
p = angr.Project("get")
cfg = p.analyses.CFGEmulated()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/analysis.py", line 115, in __call__
oself.__init__(*args, **kwargs)
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/cfg/cfg_emulated.py", line 306, in __init__
self._analyze()
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/forward_analysis/forward_analysis.py", line 216, in _analyze
self._analysis_core_baremetal()
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/forward_analysis/forward_analysis.py", line 368, in _analysis_core_baremetal
self._process_job_and_get_successors(job_info)
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/forward_analysis/forward_analysis.py", line 386, in _process_job_and_get_successors
successors = self._get_successors(job)
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/cfg/cfg_emulated.py", line 1295, in _get_successors
resolved, resolved_targets, ij = self._indirect_jump_encountered(addr, cfg_node, irsb, func_addr,
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/cfg/cfg_base.py", line 2331, in _indirect_jump_encountered
resolved, resolved_targets = self._resolve_indirect_jump_timelessly(addr, irsb, func_addr, jumpkind)
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/cfg/cfg_base.py", line 2274, in _resolve_indirect_jump_timelessly
r, resolved_targets = res.resolve(self, addr, func_addr, block, jumpkind)
File "/home/manuel/.virtualenvs/angr/lib/python3.8/site-packages/angr/analyses/cfg/indirect_jump_resolvers/arm_elf_fast.py", line 60, in resolve
stmt = block.statements[stmt_idx]
IndexError: list index out of range

# Fixed code
def _indirect_jump_encountered(
    self,
    addr: int,
    cfg_node: CFGNode,
    irsb: pyvex.IRSB,
    func_addr: int,
    stmt_idx: Union[int, str] = DEFAULT_STATEMENT,
) -> Tuple[bool, List[int], Optional[IndirectJump]]:
    """
    Called when we encounter an indirect jump. We will try to resolve this indirect jump using timeless (fast)
    indirect jump resolvers. If it cannot be resolved, we will see if this indirect jump has been resolved before.

    :param addr:        Address of the block containing the indirect jump.
    :param cfg_node:    The CFGNode instance of the block that contains the indirect jump.
    :param irsb:        The IRSB instance of the block that contains the indirect jump. It must be lifted with
                        cross-instruction optimization disabled (cross_insn_opt=True when opt_level=1, or
                        opt_level=0).
    :param func_addr:   Address of the current function.
    :param stmt_idx:    ID of the source statement.

    :return:    A 3-tuple of (whether it is resolved or not, all resolved targets, an IndirectJump object
                if there is one or None otherwise)
    """

    jumpkind = irsb.jumpkind
    l.debug("IRSB %#x has an indirect jump (%s) as its default exit.", addr, jumpkind)

    # try resolving it fast
    resolved, resolved_targets = self._resolve_indirect_jump_timelessly(
        addr, irsb, func_addr, jumpkind
    )
    if resolved:
        l.debug(
            "Indirect jump at block %#x is resolved by a timeless indirect jump resolver. "
            "%d targets found.",
            addr,
            len(resolved_targets),
        )
        return True, resolved_targets, None

    l.debug(
        "Indirect jump at block %#x cannot be resolved by a timeless indirect jump resolver.",
        addr,
    )

    # Add it to our set. Will process it later if user allows.
    # Create an IndirectJump instance
    if addr not in self.indirect_jumps:
        if self.project.arch.branch_delay_slot:
            if len(cfg_node.instruction_addrs) < 2:
                # sanity check
                # decoding failed when decoding the second instruction (or even the first instruction)
                return False, [], None
            ins_addr = cfg_node.instruction_addrs[-2]
        else:
            ins_addr = cfg_node.instruction_addrs[-1]
        ij = IndirectJump(
            addr, ins_addr, func_addr, jumpkind, stmt_idx, resolved_targets=[]
        )
        self.indirect_jumps[addr] = ij
        resolved = False
    else:
        ij = self.indirect_jumps[addr]  # type: IndirectJump
        resolved = len(ij.resolved_targets) > 0

    return resolved, ij.resolved_targets, ij