Fix bug in construct_nfa
Intermediate final states were being left in by add_fsa(); we always want to mark the added FSA's final state as non-final.
This commit is contained in:
@@ -25,6 +25,9 @@ static void add_fsa(fsa_t *f, const fsa_t *o, int *init_out, int *final_out)
|
||||
}
|
||||
memcpy(f->states + f->count, o->states, o->count * sizeof(fsa_state_t));
|
||||
|
||||
// Mark o's final state as non-final.
|
||||
f->states[f->count].final = false;
|
||||
|
||||
// Retarget the rules of the copied states to refer to the new
|
||||
// state indices.
|
||||
for (int i = f->count; i < count; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user