(self)
Map our current slice to CFG.

        Based on self._statements_per_run and self._exit_statements_per_run, this method will traverse the CFG and
        check if there is any missing block on the path. If there is, the default exit of that missing block will be
        included in the slice. This is because Slicecutor cannot skip individual basic blocks along a path.
Map our current slice to CFG.
Map our current slice to CFG .
def _map_to_cfg(self):
        """
        Map our current slice to CFG.

        Based on self._statements_per_run and self._exit_statements_per_run, this method will traverse the CFG and
        check if there is any missing block on the path. If there is, the default exit of that missing block will be
        included in the slice. This is because Slicecutor cannot skip individual basic blocks along a path.
        """

        exit_statements_per_run = self.chosen_exits
        new_exit_statements_per_run = defaultdict(list)

        while len(exit_statements_per_run):
            for block_address, exits in exit_statements_per_run.items():
                for stmt_idx, exit_target in exits:
                    if exit_target not in self.chosen_exits:
                        # Oh we found one!
                        # The default exit should be taken no matter where it leads to
                        # Add it to the new set
                        tpl = (DEFAULT_STATEMENT, None)
                        if tpl not in new_exit_statements_per_run[exit_target]:
                            new_exit_statements_per_run[exit_target].append(tpl)

            # Add the new ones to our global dict
            for block_address, exits in new_exit_statements_per_run.items():
                for ex in exits:
                    if ex not in self.chosen_exits[block_address]:
                        self.chosen_exits[block_address].append(ex)

            # Switch them so we can process the new set
            exit_statements_per_run = new_exit_statements_per_run
            new_exit_statements_per_run = defaultdict(list)
def _map_to_cfg ( self ) : exit_statements_per_run = self . chosen_exits new_exit_statements_per_run = defaultdict ( list ) while len ( exit_statements_per_run ) : for block_address , exits in exit_statements_per_run . items ( ) : for stmt_idx , exit_target in exits : if exit_target not in self . chosen_exits : # Oh we found one! # The default exit should be taken no matter where it leads to # Add it to the new set tpl = ( DEFAULT_STATEMENT , None ) if tpl not in new_exit_statements_per_run [ exit_target ] : new_exit_statements_per_run [ exit_target ] . append ( tpl ) # Add the new ones to our global dict for block_address , exits in new_exit_statements_per_run . items ( ) : for ex in exits : if ex not in self . chosen_exits [ block_address ] : self . chosen_exits [ block_address ] . append ( ex ) # Switch them so we can process the new set exit_statements_per_run = new_exit_statements_per_run new_exit_statements_per_run = defaultdict ( list )