summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-10-24 15:34:25 +0200
committerThomas Deutschmann <whissi@gentoo.org>2021-10-24 15:34:25 +0200
commit6006eabdf30e3e8a13cf407f290e4e309bb2d148 (patch)
tree76007dd8e44522d088016905249b52d9f1fe49c3 /dev-libs/libpcre2/files
parentdev-lang/perl: Remove broken version (diff)
downloadgentoo-6006eabdf30e3e8a13cf407f290e4e309bb2d148.tar.gz
gentoo-6006eabdf30e3e8a13cf407f290e4e309bb2d148.tar.bz2
gentoo-6006eabdf30e3e8a13cf407f290e4e309bb2d148.zip
dev-libs/libpcre2: fix incorrect detection of alternatives
...in first character search. Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'dev-libs/libpcre2/files')
-rw-r--r--dev-libs/libpcre2/files/libpcre2-10.38-fix-fix-incorrect-detection-of-alternatives-in-first-character-search.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/dev-libs/libpcre2/files/libpcre2-10.38-fix-fix-incorrect-detection-of-alternatives-in-first-character-search.patch b/dev-libs/libpcre2/files/libpcre2-10.38-fix-fix-incorrect-detection-of-alternatives-in-first-character-search.patch
new file mode 100644
index 000000000000..936bd057a0e9
--- /dev/null
+++ b/dev-libs/libpcre2/files/libpcre2-10.38-fix-fix-incorrect-detection-of-alternatives-in-first-character-search.patch
@@ -0,0 +1,49 @@
+https://github.com/PhilipHazel/pcre2/pull/22
+
+--- a/src/pcre2_jit_compile.c
++++ b/src/pcre2_jit_compile.c
+@@ -1251,10 +1251,13 @@ SLJIT_ASSERT(*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA);
+ SLJIT_ASSERT(*cc != OP_CBRA || common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] != 0);
+ SLJIT_ASSERT(start < EARLY_FAIL_ENHANCE_MAX);
+
++next_alt = cc + GET(cc, 1);
++if (*next_alt == OP_ALT)
++ fast_forward_allowed = FALSE;
++
+ do
+ {
+ count = start;
+- next_alt = cc + GET(cc, 1);
+ cc += 1 + LINK_SIZE + ((*cc == OP_CBRA) ? IMM2_SIZE : 0);
+
+ while (TRUE)
+@@ -1512,7 +1515,7 @@ do
+ {
+ count++;
+
+- if (fast_forward_allowed && *next_alt == OP_KET)
++ if (fast_forward_allowed)
+ {
+ common->fast_forward_bc_ptr = accelerated_start;
+ common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) | type_skip;
+@@ -1562,8 +1565,8 @@ do
+ else if (result < count)
+ result = count;
+
+- fast_forward_allowed = FALSE;
+ cc = next_alt;
++ next_alt = cc + GET(cc, 1);
+ }
+ while (*cc == OP_ALT);
+
+--- a/src/pcre2_jit_test.c
++++ b/src/pcre2_jit_test.c
+@@ -352,6 +352,7 @@ static struct regression_test_case regression_test_cases[] = {
+ { MU, A, 0, 0, ".[ab]?.", "xx" },
+ { MU, A, 0, 0, "_[ab]+_*a", "_aa" },
+ { MU, A, 0, 0, "#(A+)#\\d+", "#A#A#0" },
++ { MU, A, 0, 0, "(?P<size>\\d+)m|M", "4M" },
+
+ /* Bracket repeats with limit. */
+ { MU, A, 0, 0, "(?:(ab){2}){5}M", "abababababababababababM" },
+