(self, block, successor=None, **kwargs)
:param ailment.Block block:
        :return:
def _handle_block(self, block, successor=None, **kwargs):  # pylint:disable=no-self-use
        """

        :param ailment.Block block:
        :return:
        """

        if block.statements and isinstance(block.statements[-1], ailment.Stmt.Jump):
            goto_stmt = block.statements[-1]  # ailment.Stmt.Jump
            if isinstance(goto_stmt.target, ailment.Expr.Const):
                goto_target = goto_stmt.target.value
                if successor and goto_target == successor.addr:
                    can_remove = True
                elif goto_target not in self._node_addrs:
                    # the target block has been removed and is no longer exist. we assume this goto is useless
                    can_remove = True
                else:
                    can_remove = False

                if can_remove:
                    # we can remove this statement
                    block.statements = block.statements[:-1]
def _handle_block ( self , block , successor = None , * * kwargs ) : # pylint:disable=no-self-use if block . statements and isinstance ( block . statements [ - 1 ] , ailment . Stmt . Jump ) : goto_stmt = block . statements [ - 1 ] # ailment.Stmt.Jump if isinstance ( goto_stmt . target , ailment . Expr . Const ) : goto_target = goto_stmt . target . value if successor and goto_target == successor . addr : can_remove = True elif goto_target not in self . _node_addrs : # the target block has been removed and is no longer exist. we assume this goto is useless can_remove = True else : can_remove = False if can_remove : # we can remove this statement block . statements = block . statements [ : - 1 ]