From 0c885c10d7fbcb4c50f775235295a9114a40e8fb Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 28 Mar 2024 11:22:54 +0000 Subject: [PATCH] import CS pcre2-10.40-5.el9 --- .gitignore | 1 + .pcre2.metadata | 1 + ...cre2-10.40-Fix-JIT-regression-in-PHP.patch | 60 ++++++++++++++++ SOURCES/pcre2-10.40.tar.bz2.sig | Bin 310 -> 0 bytes ...10.42-Add-more-examples-fixed-by-300.patch | 65 ++++++++++++++++++ ...re-originally-unset-entries-in-recur.patch | 61 ++++++++++++++++ SPECS/pcre2.spec | 19 ++++- 7 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 SOURCES/pcre2-10.40-Fix-JIT-regression-in-PHP.patch delete mode 100644 SOURCES/pcre2-10.40.tar.bz2.sig create mode 100644 SOURCES/pcre2-10.42-Add-more-examples-fixed-by-300.patch create mode 100644 SOURCES/pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch diff --git a/.gitignore b/.gitignore index b2d8efc..5c2405e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/pcre2-10.40.tar.bz2 +SOURCES/pcre2-10.40.tar.bz2.sig diff --git a/.pcre2.metadata b/.pcre2.metadata index a6d1c32..ae73ec9 100644 --- a/.pcre2.metadata +++ b/.pcre2.metadata @@ -1 +1,2 @@ 5a433f92b29083d0d8ccd4ec56e3afbe1fa09863 SOURCES/pcre2-10.40.tar.bz2 +3f85b8b83621de8649fb623eb3d11434e4c6f989 SOURCES/pcre2-10.40.tar.bz2.sig diff --git a/SOURCES/pcre2-10.40-Fix-JIT-regression-in-PHP.patch b/SOURCES/pcre2-10.40-Fix-JIT-regression-in-PHP.patch new file mode 100644 index 0000000..3b84856 --- /dev/null +++ b/SOURCES/pcre2-10.40-Fix-JIT-regression-in-PHP.patch @@ -0,0 +1,60 @@ +From 44a4e60e0ad45d4c60b7da10e9e9531da75bb9a4 Mon Sep 17 00:00:00 2001 +From: Zoltan Herczeg +Date: Tue, 12 Jul 2022 08:35:38 +0000 +Subject: [PATCH] Fixed an issue in the backtracking optimization of character + repeats in JIT + +--- + src/pcre2_jit_compile.c | 20 ++++++++++---------- + src/pcre2_jit_test.c | 1 + + 3 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c +index e638c24..b3cffbe 100644 +--- a/src/pcre2_jit_compile.c ++++ b/src/pcre2_jit_compile.c +@@ -11517,19 +11517,19 @@ if (exact > 1) + } + } + else if (exact == 1) +- { + compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); + +- if (early_fail_type == type_fail_range) +- { +- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr); +- OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw)); +- OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0); +- OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0); +- add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); ++if (early_fail_type == type_fail_range) ++ { ++ /* Range end first, followed by range start. */ ++ OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr); ++ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw)); ++ OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, TMP2, 0); ++ OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, TMP2, 0); ++ add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_LESS_EQUAL, TMP2, 0, TMP1, 0)); + +- OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0); +- } ++ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr, STR_PTR, 0); ++ OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), early_fail_ptr + (int)sizeof(sljit_sw), STR_PTR, 0); + } + + switch(opcode) +diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c +index bb141a0..81c9582 100644 +--- a/src/pcre2_jit_test.c ++++ b/src/pcre2_jit_test.c +@@ -354,6 +354,7 @@ static struct regression_test_case regression_test_cases[] = { + { MU, A, 0, 0, "_[ab]+_*a", "_aa" }, + { MU, A, 0, 0, "#(A+)#\\d+", "#A#A#0" }, + { MU, A, 0, 0, "(?P\\d+)m|M", "4M" }, ++ { M, PCRE2_NEWLINE_CRLF, 0, 0, "\\n?.+#", "\n,\n,#" }, + + /* Bracket repeats with limit. */ + { MU, A, 0, 0, "(?:(ab){2}){5}M", "abababababababababababM" }, +-- +2.41.0 + diff --git a/SOURCES/pcre2-10.40.tar.bz2.sig b/SOURCES/pcre2-10.40.tar.bz2.sig deleted file mode 100644 index 2e5d3e4058e97eec8b28a4273183bb5a3b278ab7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 310 zcmV-60m=S}0W$;u0SEvc79j*h_Kj4#;y<$kn?~iAX5fVT4@1}m0%BQ|oB#?55SM1) zg!>Oe*j-@<|9((**C(6IycsKQ+>6cU5Iww~ao&A)dg8n!e%&Tj;?o<;y)*WojhI}& zQkDs4AQ(D1rH>z@gOJ1@I|3ORxK%|iqrAL>JtvflB!*o=crM*Im1qlHDzMG`H7pl5 zp+pGoZpw8jDSbsh4$Vcl^i<0LzSWCbwUt6@3lET0W#uB+AFNoz4JuWvj?UJ#RV>dY&gZoY>!{cJ<+2Mr<5v^euv6Y* I>E +Date: Tue, 3 Oct 2023 16:52:56 +0100 +Subject: [PATCH] Add more examples fixed by #300; update ChangeLog + +--- + testdata/testinput1 | 8 ++++++++ + testdata/testoutput1 | 22 ++++++++++++++++++++++ + 3 files changed, 34 insertions(+) + +diff --git a/testdata/testinput1 b/testdata/testinput1 +index 3d75a35..533389d 100644 +--- a/testdata/testinput1 ++++ b/testdata/testinput1 +@@ -4374,6 +4374,14 @@ + + /(?(?:(?:a(?&all))|(b))(c?))/ + aabc ++ ++/(a(b)|(c))(?1)/ ++ abc ++ cab ++ ++/(?1)(a(b)|(c))/ ++ abc ++ cab + + /(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) +diff --git a/testdata/testoutput1 b/testdata/testoutput1 +index 26d3c83..bedd924 100644 +--- a/testdata/testoutput1 ++++ b/testdata/testoutput1 +@@ -6954,6 +6954,28 @@ No match + 1: aabc + 2: + 3: ++ ++/(a(b)|(c))(?1)/ ++ abc ++ 0: abc ++ 1: ab ++ 2: b ++ cab ++ 0: cab ++ 1: c ++ 2: ++ 3: c ++ ++/(?1)(a(b)|(c))/ ++ abc ++ 0: abc ++ 1: c ++ 2: ++ 3: c ++ cab ++ 0: cab ++ 1: ab ++ 2: b + + /(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) +-- +2.41.0 + diff --git a/SOURCES/pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch b/SOURCES/pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch new file mode 100644 index 0000000..6e46092 --- /dev/null +++ b/SOURCES/pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch @@ -0,0 +1,61 @@ +From 794245ecc296724b52f5030831e58bedbffa2452 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= +Date: Tue, 3 Oct 2023 08:14:23 -0700 +Subject: [PATCH] match: also restore originally unset entries in recursion + (#300) + +A regresion from ~10.30 not affecting JIT +--- + src/pcre2_match.c | 2 +- + testdata/testinput1 | 3 +++ + testdata/testoutput1 | 7 +++++++ + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/pcre2_match.c b/src/pcre2_match.c +index 5ce1792..8b57c75 100644 +--- a/src/pcre2_match.c ++++ b/src/pcre2_match.c +@@ -5953,7 +5953,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); + { + P = (heapframe *)((char *)N - frame_size); + memcpy((char *)F + offsetof(heapframe, ovector), P->ovector, +- P->offset_top * sizeof(PCRE2_SIZE)); ++ Foffset_top * sizeof(PCRE2_SIZE)); + Foffset_top = P->offset_top; + Fcapture_last = P->capture_last; + Fcurrent_recurse = P->current_recurse; +diff --git a/testdata/testinput1 b/testdata/testinput1 +index 062dfe0..3d75a35 100644 +--- a/testdata/testinput1 ++++ b/testdata/testinput1 +@@ -4372,6 +4372,9 @@ + /^(?(DEFINE) (? a) (? b) ) (?&A) (?&B) /x + abcd + ++/(?(?:(?:a(?&all))|(b))(c?))/ ++ aabc ++ + /(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) + (?[a-z]+) +diff --git a/testdata/testoutput1 b/testdata/testoutput1 +index 1dc3b2f..26d3c83 100644 +--- a/testdata/testoutput1 ++++ b/testdata/testoutput1 +@@ -6948,6 +6948,13 @@ No match + abcd + 0: ab + ++/(?(?:(?:a(?&all))|(b))(c?))/ ++ aabc ++ 0: aabc ++ 1: aabc ++ 2: ++ 3: ++ + /(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) + (?[a-z]+) +-- +2.41.0 + diff --git a/SPECS/pcre2.spec b/SPECS/pcre2.spec index 7a669d0..d6049d0 100644 --- a/SPECS/pcre2.spec +++ b/SPECS/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.40 -Release: %{?rcversion:0.}2%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -51,6 +51,13 @@ Source1: https://ftp.pcre.org/pub/pcre/%{?rcversion:Testing/}%{name}-%{myvers Source2: https://ftp.pcre.org/pub/pcre/Public-Key # Do no set RPATH if libdir is not /usr/lib Patch0: pcre2-10.10-Fix-multilib.patch +# Upstream patch: https://github.com/PCRE2Project/pcre2/commit/4851890ede31313655e19180f4959ed348fee580 +Patch1: pcre2-10.40-Fix-JIT-regression-in-PHP.patch +# Upstream commits: +# https://github.com/PCRE2Project/pcre2/commit/794245ecc296724b52f5030831e58bedbffa2452 +# https://github.com/PCRE2Project/pcre2/commit/457c0e69a8f78d32bc7d4b6422cd01e396a4cf5d +Patch2: pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch +Patch3: pcre2-10.42-Add-more-examples-fixed-by-300.patch BuildRequires: autoconf BuildRequires: automake @@ -258,6 +265,16 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Fri Feb 16 2024 Lukas Javorsky - 10.40-5 +- Rebuilt for added pcre2-tools into CRB + +* Mon Nov 13 2023 Lukas Javorsky - 10.40-4 +- Fix an issue with restoring originally unset entries in recursion +- Resolves: BZ#2248133 + +* Tue Oct 17 2023 Lukas Javorsky - 10.40-3 +- Fix issue in the backtracking optimization of character in JIT + * Wed May 18 2022 Lukas Javorsky - 10.40-2 - Explicitly require uft subpackages in tools subpackage