diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-09-12 06:29:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-09-12 06:29:19 -0700 |
commit | 656a69fcefc0787ac0c2e22e8b1750e577c4b759 (patch) | |
tree | 998303061aa52ca5a942a508d1cbfb70a7e4243e /regex.c | |
parent | fc5935a9fe816d64291e66b1ca5133a27f5f0230 (diff) | |
download | txr-656a69fcefc0787ac0c2e22e8b1750e577c4b759.tar.gz txr-656a69fcefc0787ac0c2e22e8b1750e577c4b759.tar.bz2 txr-656a69fcefc0787ac0c2e22e8b1750e577c4b759.zip |
regex: bugfix: incorrect use of nfa_move_closure.
This goes back to November 2, 2009 commit,
"Start of implementation for freestyle matching",
6191fbb2ca7a9ac339dd3994bdea8273ceb0a24d
It is exposed if we perform an epsilon threading
optimization on the NFA graph.
* regex.c (regex_machine_feed): We must pass the new,
incremented value of the visited counter, to nfa_move_closure.
States have already been tagged with the old value before
the call to regex_machine_feed, so we risk failing to
visit some states and include them in the closure.
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2418,7 +2418,7 @@ static regm_result_t regex_machine_feed(regex_machine_t *regm, wchar_t ch) regm->n.nclos = nfa_move_closure(regm->n.stack, regm->n.set, regm->n.nclos, - regm->n.nstates, ch, regm->n.visited++, + regm->n.nstates, ch, ++regm->n.visited, &accept); if (regm->n.nfa.start) |