diff --git a/parser/libapparmor_re/regexp.y b/parser/libapparmor_re/regexp.y index 96bbbe86c..1659c5dbf 100644 --- a/parser/libapparmor_re/regexp.y +++ b/parser/libapparmor_re/regexp.y @@ -1370,6 +1370,13 @@ DFA::DFA(Node *root, dfaflags_t flags) : root(root) here.cases.insert(*j); } } + + for (depth_first_traversal i(root); i; i++) { + (*i)->firstpos.clear(); + (*i)->lastpos.clear(); + (*i)->followpos.clear(); + } + if (flags & (DFA_DUMP_STATS)) fprintf(stderr, "\033[2KCreated dfa: states %ld\tmatching %d\tnonmatching %d\n", states.size(), match_count, nomatch_count);