diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-10-13 21:30:36 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-10-13 21:30:36 +0300 |
commit | 956767af308bbdf4a92f9048a6080c4046a08e03 (patch) | |
tree | 3e0d896c0dfaeb95c1a1e4cc0674bc2dcf434df0 | |
parent | 90478dd4c89715ad3e5dd599c1a615df8433db72 (diff) | |
parent | 8b0d41a9bfe9e97c8580e40eb34c0a1889663b38 (diff) | |
download | egawk-956767af308bbdf4a92f9048a6080c4046a08e03.tar.gz egawk-956767af308bbdf4a92f9048a6080c4046a08e03.tar.bz2 egawk-956767af308bbdf4a92f9048a6080c4046a08e03.zip |
Merge branch 'master' into feature/nocopy
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | dfa.c | 34 |
2 files changed, 38 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2016-10-13 Arnold D. Robbins <arnold@skeeve.com> + + * dfa.c: Sync with GNULIB. + 2016-10-12 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (make_profile_number): Allocate an extra byte for the @@ -3131,6 +3131,39 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, bool allow_nl, unsigned char saved_end; size_t nlcount = 0; + if (MAX_TRCOUNT <= d->sindex) + { + for (s = d->min_trcount; s < d->sindex; s++) + { + free (d->states[s].elems.elems); + free (d->states[s].mbps.elems); + } + d->sindex = d->min_trcount; + + if (d->trans) + { + for (s = 0; s < d->tralloc; s++) + { + free (d->trans[s]); + free (d->fails[s]); + d->trans[s] = d->fails[s] = NULL; + } + d->trcount = 0; + } + + if (d->localeinfo.multibyte && d->mb_trans) + { + for (s = -1; s < d->tralloc; s++) + { + free (d->mb_trans[s]); + d->mb_trans[s] = NULL; + } + for (s = 0; s < d->min_trcount; s++) + d->states[s].mb_trindex = -1; + d->mb_trcount = 0; + } + } + if (!d->tralloc) { realloc_trans_if_necessary (d, 1); @@ -3460,6 +3493,7 @@ dfassbuild (struct dfa *d) sup->tokens[j++] = EMPTY; break; } + /* fallthrough */ default: sup->tokens[j++] = d->tokens[i]; if ((0 <= d->tokens[i] && d->tokens[i] < NOTCHAR) |