From 0a6732bf275cd138134950549e2f4305e5fa5eed Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 21 Sep 2015 17:14:52 +0000 Subject: [d7ea9f9853] Contributed patch from tgl with Postgres. --- generic/regcomp.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/generic/regcomp.c b/generic/regcomp.c index d23076b..b1c02d8 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 */ } } -- cgit v0.12 From e4bb6f372f554b29e021e1ab90f875e27479f4a3 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 21 Sep 2015 17:29:22 +0000 Subject: [a3c3508599] Fix typo that reversed test sense in prior fix for [3610026]. --- generic/regc_color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/regc_color.c b/generic/regc_color.c index 58de004..35e7904 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) { -- cgit v0.12