summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2021-06-07 20:46:27 +0200
committerLars Wendler <polynomial-c@gentoo.org>2021-06-07 20:47:18 +0200
commit646212efa126022d0001ab5c75bcb8562e3b84fe (patch)
treea3293a18e16b22eb7a0212fc58a391790b7aed0c /dev-libs/libpcre2/files
parentapp-portage/eix: Bump to 0.35.1 (diff)
downloadgentoo-646212efa126022d0001ab5c75bcb8562e3b84fe.tar.gz
gentoo-646212efa126022d0001ab5c75bcb8562e3b84fe.tar.bz2
gentoo-646212efa126022d0001ab5c75bcb8562e3b84fe.zip
dev-libs/libpcre2: Revbump to fix a JIT issue
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'dev-libs/libpcre2/files')
-rw-r--r--dev-libs/libpcre2/files/libpcre2-10.37-jit_fixes.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/dev-libs/libpcre2/files/libpcre2-10.37-jit_fixes.patch b/dev-libs/libpcre2/files/libpcre2-10.37-jit_fixes.patch
new file mode 100644
index 000000000000..6ee5494f2bc5
--- /dev/null
+++ b/dev-libs/libpcre2/files/libpcre2-10.37-jit_fixes.patch
@@ -0,0 +1,80 @@
+Index: pcre2/ChangeLog
+===================================================================
+--- pcre2/ChangeLog (revision 1314)
++++ pcre2/ChangeLog (revision 1315)
+@@ -1,7 +1,14 @@
+ Change Log for PCRE2
+ --------------------
+
++Version 10.38-RC1 xx-xxx-2021
++-----------------------------
+
++1. Fix invalid single character repetition issues in JIT when the repetition
++is inside a capturing bracket and the bracket is preceeded by character
++literals.
++
++
+ Version 10.37 26-May-2021
+ -------------------------
+
+Index: pcre2/src/pcre2_jit_compile.c
+===================================================================
+--- pcre2/src/pcre2_jit_compile.c (revision 1314)
++++ pcre2/src/pcre2_jit_compile.c (revision 1315)
+@@ -1236,15 +1236,16 @@
+
+ return: current number of iterators enhanced with fast fail
+ */
+-static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start, sljit_s32 depth, int start)
++static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start,
++ sljit_s32 depth, int start, BOOL fast_forward_allowed)
+ {
+ PCRE2_SPTR begin = cc;
+ PCRE2_SPTR next_alt;
+ PCRE2_SPTR end;
+ PCRE2_SPTR accelerated_start;
++BOOL prev_fast_forward_allowed;
+ int result = 0;
+ int count;
+-BOOL fast_forward_allowed = TRUE;
+
+ 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);
+@@ -1476,6 +1477,7 @@
+ case OP_CBRA:
+ end = cc + GET(cc, 1);
+
++ prev_fast_forward_allowed = fast_forward_allowed;
+ fast_forward_allowed = FALSE;
+ if (depth >= 4)
+ break;
+@@ -1484,7 +1486,7 @@
+ if (*end != OP_KET || (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0))
+ break;
+
+- count = detect_early_fail(common, cc, private_data_start, depth + 1, count);
++ count = detect_early_fail(common, cc, private_data_start, depth + 1, count, prev_fast_forward_allowed);
+
+ if (PRIVATE_DATA(cc) != 0)
+ common->private_data_ptrs[begin - common->start] = 1;
+@@ -13657,7 +13659,7 @@
+ private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw);
+
+ if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_assert_back)
+- detect_early_fail(common, common->start, &private_data_size, 0, 0);
++ detect_early_fail(common, common->start, &private_data_size, 0, 0, TRUE);
+
+ set_private_data_ptrs(common, &private_data_size, ccend);
+
+Index: pcre2/src/pcre2_jit_test.c
+===================================================================
+--- pcre2/src/pcre2_jit_test.c (revision 1314)
++++ pcre2/src/pcre2_jit_test.c (revision 1315)
+@@ -351,6 +351,7 @@
+ { MU, A, 0, 0, ".[ab]*a", "xxa" },
+ { MU, A, 0, 0, ".[ab]?.", "xx" },
+ { MU, A, 0, 0, "_[ab]+_*a", "_aa" },
++ { MU, A, 0, 0, "#(A+)#\\d+", "#A#A#0" },
+
+ /* Bracket repeats with limit. */
+ { MU, A, 0, 0, "(?:(ab){2}){5}M", "abababababababababababM" },