rose: don't merge large acyclic suffixes

Check earlier on in mergeSuffixes that we're not proposing to merge
suffixes above our limit from the acyclic merge path.
This commit is contained in:
Justin Viiret 2016-08-05 10:52:24 +10:00 committed by Matthew Barr
parent b859e5cb8a
commit 8be6c8b2ca

View File

@ -2189,6 +2189,11 @@ void mergeSuffixes(RoseBuildImpl &tbi, SuffixBouquet &suffixes,
suffix_id s1 = *it;
const deque<RoseVertex> &verts1 = suffixes.vertices(s1);
assert(s1.graph() && s1.graph()->kind == NFA_SUFFIX);
// Caller should ensure that we don't propose merges of graphs that are
// already too big.
assert(num_vertices(*s1.graph()) < small_merge_max_vertices(tbi.cc));
deque<suffix_id> merged;
for (auto jt = next(it); jt != suffixes.end(); ++jt) {
suffix_id s2 = *jt;
@ -2306,6 +2311,10 @@ void mergeAcyclicSuffixes(RoseBuildImpl &tbi) {
assert(!g[v].suffix.haig);
if (num_vertices(*h) >= small_merge_max_vertices(tbi.cc)) {
continue;
}
if (!isAcyclic(*h)) {
continue;
}