'Based on control dependence graph, pick all exits (statements) that lead to the target.
:param target_node: A CFGNode instance.
:returns:           A set of new tainted code locations.'

def _handle_control_dependence(self, target_node):

    new_taints = set()
    cdg_guardians = self._cdg.get_guardians(target_node)
    if (not cdg_guardians):
        pass
    else:
        for predecessor in cdg_guardians:
            exits = self._find_exits(predecessor, target_node)
            for (stmt_idx, target_addresses) in exits.iteritems():
                if (stmt_idx is not None):
                    self._pick_statement(predecessor.addr, self._normalize_stmt_idx(predecessor.addr, stmt_idx))
                    if (stmt_idx == 'default'):
                        conditional_exits = self._conditional_exits(predecessor.addr)
                        for conditional_exit_stmt_id in conditional_exits:
                            cl = CodeLocation(predecessor.addr, self._normalize_stmt_idx(predecessor.addr, conditional_exit_stmt_id))
                            new_taints.add(cl)
                            self._pick_statement(predecessor.addr, self._normalize_stmt_idx(predecessor.addr, conditional_exit_stmt_id))
                if (target_addresses is not None):
                    if (stmt_idx is not None):
                        cl = CodeLocation(predecessor.addr, self._normalize_stmt_idx(predecessor.addr, stmt_idx))
                        new_taints.add(cl)
                    for target_address in target_addresses:
                        self._pick_exit(predecessor.addr, stmt_idx, target_address)
                all_simple_paths = list(networkx.all_simple_paths(self._cfg.graph, predecessor, target_node, cutoff=3))
                previous_node = None
                for path in all_simple_paths:
                    for node in path:
                        self._pick_statement(node.addr, self._normalize_stmt_idx(node.addr, 'default'))
                        if (previous_node is not None):
                            self._pick_exit(previous_node.addr, 'default', node.addr)
    return new_taints
