'Returns a merger of this path with all the paths in other_paths.
:param other_paths: list of paths to merge together with self
:param common_history: a PathHistory node shared by all the paths. Must be provided; causes
merging to be more efficient, and actions and such are merged.
:returns: the merged Path
:rtype: Path'

def merge(self, other_paths, common_history):

    all_paths = (other_paths + [self])
    if (len(set((o.addr for o in all_paths))) != 1):
        raise AngrPathError('Unable    to    merge    paths.')
    constraints = [p.history.constraints_since(common_history) for p in all_paths]
    (new_state, merge_conditions, _) = all_paths[0].state.merge(merge_conditions=constraints, common_ancestor=common_history.state, *[p.state for p in all_paths[1:]])
    new_path = Path(all_paths[0]._project, new_state, path=all_paths[0])
    new_path.history = PathHistory(common_history)
    new_path.history.merged_from.extend((p.history for p in all_paths))
    new_path.history.merge_conditions = merge_conditions
    new_path.history._record_state(new_state)
    new_path.history._runstr = ('MERGE    POINT    (at    %#x)' % new_path.addr)
    new_path.history.length -= 1
    new_path._upcoming_merge_points = []
    return new_path
