summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-13 21:30:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-10-13 21:30:43 +0300
commit6b3f460c7f70d3cb0fac0fb45188b2a7776d653e (patch)
treef3d56fad5e9acdac032431035a454f4d983c7ce2
parent47873e9e88e573737c96d9a0c649a05ce7d61f0d (diff)
parent8b0d41a9bfe9e97c8580e40eb34c0a1889663b38 (diff)
downloadgawk-6b3f460c7f70d3cb0fac0fb45188b2a7776d653e.tar.gz
Merge branch 'master' into feature/typed-regex
-rw-r--r--ChangeLog4
-rw-r--r--dfa.c34
2 files changed, 38 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c0090ad..8f632e5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/dfa.c b/dfa.c
index b162a3b3..62bb6435 100644
--- a/dfa.c
+++ b/dfa.c
@@ -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)