pgsql: Fix infinite-loop risk in fixempties() stage of regex compilatio

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix infinite-loop risk in fixempties() stage of regex compilatio
Date: 2013-03-07 16:51:59
Message-ID: E1UDe2x-0000fi-Re@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix infinite-loop risk in fixempties() stage of regex compilation.

The previous coding of this function could get into situations where it
would never terminate, because successive passes would re-add EMPTY arcs
that had been removed by the previous pass. Rewrite the function
completely using a new algorithm that is guaranteed to terminate, and
also seems to be usually faster than the old one. Per Tcl bugs 3604074
and 3606683.

Tom Lane and Don Porter

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1dd92380b00781b8318d6d3fb2817468e43fe3a5

Modified Files
--------------
src/backend/regex/regc_nfa.c | 314 ++++++++++++++++++++++++++++++++---------
src/backend/regex/regcomp.c | 12 +-
2 files changed, 253 insertions(+), 73 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David E. Wheeler 2013-03-07 17:14:57 Re: Materialized views WIP patch
Previous Message Kevin Grittner 2013-03-07 15:55:29 Re: Materialized views WIP patch