diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-11-01 19:58:47 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-11-01 19:58:47 +0200 |
commit | 6faeff915e961443d66b10caf9af4cbed6fb8451 (patch) | |
tree | a97975ecfa619a23637ffa24af41e10d57f0e57c /support | |
parent | c2f26d724d65ae3972920013e785906bb4983c96 (diff) | |
download | egawk-6faeff915e961443d66b10caf9af4cbed6fb8451.tar.gz egawk-6faeff915e961443d66b10caf9af4cbed6fb8451.tar.bz2 egawk-6faeff915e961443d66b10caf9af4cbed6fb8451.zip |
Fix a bug in dfa.c, add test case.
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 4 | ||||
-rw-r--r-- | support/dfa.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index b81b0e71..edef437e 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,7 @@ +2020-11-01 Arnold D. Robbins <arnold@skeeve.com> + + * dfa.c: Synced from GNULIB. + 2020-10-15 Arnold D. Robbins <arnold@skeeve.com> * random.c: Move code to using prototypes. diff --git a/support/dfa.c b/support/dfa.c index 8aef2f37..df32dd90 100644 --- a/support/dfa.c +++ b/support/dfa.c @@ -2437,7 +2437,7 @@ merge_nfa_state (struct dfa *d, idx_t tindex, char *flags, continue; } - if (!(flags[sindex] & (OPT_LPAREN | OPT_RPAREN))) + if (sindex != tindex && !(flags[sindex] & (OPT_LPAREN | OPT_RPAREN))) { idx_t j; @@ -2445,6 +2445,9 @@ merge_nfa_state (struct dfa *d, idx_t tindex, char *flags, { idx_t dindex = follows[tindex].elems[j].index; + if (dindex == tindex) + continue; + if (follows[tindex].elems[j].constraint != iconstraint) continue; |