pgsql: Fix infinite-loop risk in fixempties() stage of regex compilatio
pgsql: Fix infinite-loop risk in fixempties() stage of regex compilatio
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
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 ------ REL8_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/f85e3f37625745bee9df9e9a4cc809f64fec9828 Modified Files -------------- src/backend/regex/regc_nfa.c | 314 ++++++++++++++++++++++++++++++++--------- src/backend/regex/regcomp.c | 12 +- 2 files changed, 253 insertions(+), 73 deletions(-)