dfa: don't clear states, just mark dfa dead

The previous change caused some assertion issues.
This commit is contained in:
Justin Viiret
2017-06-23 13:01:47 +10:00
committed by Matthew Barr
parent 3d4d39b8a9
commit 75e4aefabe
4 changed files with 19 additions and 1 deletions

View File

@@ -197,7 +197,6 @@ bool clear_deeper_reports(raw_dfa &raw, u32 max_offset) {
return ds.reports.empty() && ds.reports_eod.empty();
})) {
DEBUG_PRINTF("no reports left at all, dfa is dead\n");
raw.states.clear();
raw.start_anchored = DEAD_STATE;
raw.start_floating = DEAD_STATE;
}
@@ -287,4 +286,9 @@ bool can_die_early(const raw_dfa &raw, u32 age_limit) {
return can_die_early(raw, raw.start_anchored, visited, age_limit);
}
bool is_dead(const raw_dfa &rdfa) {
return rdfa.start_anchored == DEAD_STATE &&
rdfa.start_floating == DEAD_STATE;
}
} // namespace ue2