Re: improve performance of PCRE2 bug 2642 bug workaround
On 3/22/22 18:09, Carlo Marcelo Arenas Belón wrote:
> AFAIK the contents of the bugzilla are no longer accessible to anyone (lost in the migration of PCRE2 to github),
Yes, that confused me too.
> the bug will trigger when both PCRE2_UTF and PCRE2_MULTILINE are set (as shown in the PCRE2 regression added), with the later set by default in git and NEVER set in GNU grep, hence why I later retracted[6] my suggestion to add the workaround to grep
OK, thanks, I installed the attached to GNU grep and we'll call it a day.
From 743b1f6f5ca7ee86348fa0593da2eff03df1a82a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 22 Mar 2022 20:12:38 -0700
Subject: [PATCH] grep: Remove recent PCRE2 bug workarounds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* src/pcresearch.c (Pcompile): Remove recent workaround for PCRE2
bugs; apparently it’s not needed. This reverts back to where
things were before today. Suggested by Carlo Arenas in:
https://lists.gnu.org/r/grep-devel/2022-03/msg00006.html
---
src/pcresearch.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/pcresearch.c b/src/pcresearch.c
index 6947838..f332a44 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -157,13 +157,6 @@ Pcompile (char *pattern, idx_t size, reg_syntax_t ignored, bool exact)
#endif
}
-#if defined PCRE2_MATCH_INVALID_UTF && !(10 < PCRE2_MAJOR + (36 <= PCRE2_MINOR))
- /* Work around PCRE2 bug 2642, and another bug reportedly fixed in
- PCRE2 commit e0c6029a62db9c2161941ecdf459205382d4d379. */
- if (flags & (PCRE2_UTF | PCRE2_CASELESS))
- flags |= PCRE2_NO_START_OPTIMIZE;
-#endif
-
/* FIXME: Remove this restriction. */
if (rawmemchr (pattern, '\n') != patlim)
die (EXIT_TROUBLE, 0, _("the -P option only supports a single pattern"));
--
2.32.0