diff options
author | dgp <dgp@users.sourceforge.net> | 2015-09-21 18:50:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-09-21 18:50:23 (GMT) |
commit | 42b210de3d1f3c3e38df2ee20bba91a796324108 (patch) | |
tree | 9ae7931adc68cbfe0d97e8e9dc51b58b212ee4c0 /generic | |
parent | d4aa4fa0fbce6e8491b76598051ea0e596d16331 (diff) | |
parent | f0f0d2b1abf721e7cae3584cf4fc01cd5e0b9f66 (diff) | |
download | tcl-42b210de3d1f3c3e38df2ee20bba91a796324108.zip tcl-42b210de3d1f3c3e38df2ee20bba91a796324108.tar.gz tcl-42b210de3d1f3c3e38df2ee20bba91a796324108.tar.bz2 |
[d7ea9f985][a3c3508599] Internal regexp fixes that cleanup and streamline.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/regc_color.c | 2 | ||||
-rw-r--r-- | generic/regcomp.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/generic/regc_color.c b/generic/regc_color.c index f5d6dfd..2e167fe 100644 --- a/generic/regc_color.c +++ b/generic/regc_color.c @@ -259,7 +259,7 @@ newcolor( return COLORLESS; /* too many colors */ } n = cm->ncds * 2; - if (n < MAX_COLOR + 1) { + if (n > MAX_COLOR + 1) { n = MAX_COLOR + 1; } if (cm->cd == cm->cdspace) { diff --git a/generic/regcomp.c b/generic/regcomp.c index 4f0c139..6fa3964 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -593,13 +593,15 @@ makesearch( break; } } + + /* + * We want to mark states as being in the list already by having non + * NULL tmp fields, but we can't just store the old slist value in tmp + * because that doesn't work for the first such state. Instead, the + * first list entry gets its own address in tmp. + */ if (b != NULL && s->tmp == NULL) { - /* - * Must be split if not already in the list (fixes bugs 505048, - * 230589, 840258, 504785). - */ - - s->tmp = slist; + s->tmp = (slist != NULL) ? slist : s; slist = s; } } @@ -620,7 +622,7 @@ makesearch( freearc(nfa, a); } } - s2 = s->tmp; + s2 = (s->tmp != s) ? s->tmp : NULL; s->tmp = NULL; /* clean up while we're at it */ } } |