Fix restoring a verb chaing list when exiting a JIT-compiled recursive function

This commit is contained in:
Petr Písař 2020-02-17 14:26:03 +01:00
parent 2234bf1ad0
commit d62998c89c
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,55 @@
From a6749bb6c7c6fbfe849fb7e4e8dcf9d0e767d3e4 Mon Sep 17 00:00:00 2001
From: zherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>
Date: Mon, 10 Feb 2020 10:18:01 +0000
Subject: [PATCH] Fix control verb chain restoration issue in JIT.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1217 6239d852-aaf2-0410-a92c-79f79f948069
Petr Písař: Ported to 10.34.
---
src/pcre2_jit_compile.c | 8 ++++----
src/pcre2_jit_test.c | 1 +
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 7874fac..10665a8 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -2693,8 +2693,8 @@ while (cc < ccend)
}
if (common->control_head_ptr != 0 && !control_head_found)
{
- shared_srcw[0] = common->control_head_ptr;
- shared_count = 1;
+ private_srcw[0] = common->control_head_ptr;
+ private_count = 1;
control_head_found = TRUE;
}
cc += 1 + 2 + cc[1];
@@ -2704,8 +2704,8 @@ while (cc < ccend)
SLJIT_ASSERT(common->control_head_ptr != 0);
if (!control_head_found)
{
- shared_srcw[0] = common->control_head_ptr;
- shared_count = 1;
+ private_srcw[0] = common->control_head_ptr;
+ private_count = 1;
control_head_found = TRUE;
}
cc++;
diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
index a188724..187e565 100644
--- a/src/pcre2_jit_test.c
+++ b/src/pcre2_jit_test.c
@@ -861,6 +861,7 @@ static struct regression_test_case regression_test_cases[] = {
{ MU, A, 0, 0 | F_NOMATCH, "(?(?=a)a(*THEN)b|ad)", "ad" },
{ MU, A, 0, 0, "(?!(?(?=a)ab|b(*THEN)d))bn|bnn", "bnn" },
{ MU, A, 0, 0, "(?=(*THEN: ))* ", " " },
+ { MU, A, 0, 0, "a(*THEN)(?R) |", "a" },
/* Recurse and control verbs. */
{ MU, A, 0, 0, "(a(*ACCEPT)b){0}a(?1)b", "aacaabb" },
--
2.21.1

View File

@ -9,7 +9,7 @@
#%%global rcversion RC1 #%%global rcversion RC1
Name: pcre2 Name: pcre2
Version: 10.34 Version: 10.34
Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist}.1 Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist}
%global myversion %{version}%{?rcversion:-%rcversion} %global myversion %{version}%{?rcversion:-%rcversion}
Summary: Perl-compatible regular expression library Summary: Perl-compatible regular expression library
# the library: BSD with exceptions # the library: BSD with exceptions
@ -71,6 +71,9 @@ Patch6: pcre2-10.34-Fix-bug-in-processing-DEFINE-.-within-lookbehind-ass.pat
# Prevent from a stack exhaustion when studying a pattern for nested groups by # Prevent from a stack exhaustion when studying a pattern for nested groups by
# putting a limit of 1000 recursive calls, in upstream after 10.34 # putting a limit of 1000 recursive calls, in upstream after 10.34
Patch7: pcre2-10.34-Limit-function-recursion-in-pcre2_study-to-avoid-sta.patch Patch7: pcre2-10.34-Limit-function-recursion-in-pcre2_study-to-avoid-sta.patch
# Fix restoring a verb chaing list when exiting a JIT-compiled recursive
# function, in upstream after 10.34
Patch8: pcre2-10.34-Fix-control-verb-chain-restoration-issue-in-JIT.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: coreutils BuildRequires: coreutils
@ -156,6 +159,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test.
%patch5 -p1 %patch5 -p1
%patch6 -p1 %patch6 -p1
%patch7 -p1 %patch7 -p1
%patch8 -p1
# Because of multilib patch # Because of multilib patch
libtoolize --copy --force libtoolize --copy --force
autoreconf -vif autoreconf -vif
@ -253,6 +257,10 @@ make %{?_smp_mflags} check VERBOSE=yes
%{_mandir}/man1/pcre2test.* %{_mandir}/man1/pcre2test.*
%changelog %changelog
* Mon Feb 17 2020 Petr Pisar <ppisar@redhat.com> - 10.34-6
- Fix restoring a verb chaing list when exiting a JIT-compiled recursive
function
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.34-5.1 * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.34-5.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild