!43 Correct stack unwinding inside recursions when seeing (*SKIP).
From: @zhangyiru330 Reviewed-by: Signed-off-by:
This commit is contained in:
commit
3e2ad10ff1
@ -0,0 +1,45 @@
|
|||||||
|
From 354e02f1413e6a429174e2c1681cc825361c2159 Mon Sep 17 00:00:00 2001
|
||||||
|
From: jzmaddock <john@johnmaddock.co.uk>
|
||||||
|
Date: Wed, 20 Oct 2021 12:12:57 +0100
|
||||||
|
Subject: [PATCH] Correct stack unwinding inside recursions when seeing (*SKIP).
|
||||||
|
|
||||||
|
Fixes https://github.com/boostorg/regex/issues/152.
|
||||||
|
|
||||||
|
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
||||||
|
Signed-off-by: jzmaddock <john@johnmaddock.co.uk>
|
||||||
|
---
|
||||||
|
boost/regex/v4/perl_matcher_non_recursive.hpp | 3 ++-
|
||||||
|
libs/regex/test/regress/test_perl_ex.cpp | 3 +++
|
||||||
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/boost/regex/v4/perl_matcher_non_recursive.hpp b/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||||
|
index eb470a78d..e5453e9e7 100644
|
||||||
|
--- a/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||||
|
+++ b/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||||
|
@@ -427,7 +427,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||||
|
{
|
||||||
|
// Must be unwinding from a COMMIT/SKIP/PRUNE and the independent
|
||||||
|
// sub failed, need to unwind everything else:
|
||||||
|
- while(unwind(false));
|
||||||
|
+ while (m_backup_state->state_id)
|
||||||
|
+ unwind(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||||
|
diff --git a/libs/regex/test/regress/test_perl_ex.cpp b/libs/regex/test/regress/test_perl_ex.cpp
|
||||||
|
index 6a53256d1..ff74a0742 100644
|
||||||
|
--- a/libs/regex/test/regress/test_perl_ex.cpp
|
||||||
|
+++ b/libs/regex/test/regress/test_perl_ex.cpp
|
||||||
|
@@ -997,6 +997,9 @@ void test_verbs()
|
||||||
|
TEST_REGEX_SEARCH("AA+(*SKIP)(B|Z)|AC", perl, "AAAC", match_default, make_array(-2, -2));
|
||||||
|
TEST_REGEX_SEARCH("AA+(*SKIP)B|C", perl, "AAAC", match_default, make_array(3, 4, -2, -2));
|
||||||
|
|
||||||
|
+ // https://github.com/boostorg/regex/issues/152
|
||||||
|
+ TEST_REGEX_SEARCH("\\A((\x1f((?1) )?+)?+(*SKIP) *?(?2)*?)\\z", perl, "\x20\x1f\x1f\x20", match_default, make_array(-2, -2));
|
||||||
|
+
|
||||||
|
TEST_REGEX_SEARCH("^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})", perl, "aaaxxxxxx", match_default, make_array(0, 9, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})", perl, "aaa++++++", match_default, make_array(-2, -2));
|
||||||
|
TEST_REGEX_SEARCH("^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})", perl, "bbbxxxxx", match_default, make_array(0, 8, -2, -2));
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
12
boost.spec
12
boost.spec
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
Name: boost
|
Name: boost
|
||||||
Version: 1.73.0
|
Version: 1.73.0
|
||||||
Release: 5
|
Release: 6
|
||||||
Summary: The free peer-reviewed portable C++ source libraries
|
Summary: The free peer-reviewed portable C++ source libraries
|
||||||
License: Boost Software License V1.0
|
License: Boost Software License 1.0
|
||||||
URL: http://www.boost.org
|
URL: http://www.boost.org
|
||||||
Source0: https://sourceforge.net/projects/boost/files/boost/%{version}/%{toplev_dirname}.tar.bz2
|
Source0: https://sourceforge.net/projects/boost/files/boost/%{version}/%{toplev_dirname}.tar.bz2
|
||||||
Source1: libboost_thread.so
|
Source1: libboost_thread.so
|
||||||
@ -47,6 +47,7 @@ Patch4: boost-1.66.0-no-rpath.patch
|
|||||||
Patch9000: regex-fix-dead-loop-in-parse_repeat.patch
|
Patch9000: regex-fix-dead-loop-in-parse_repeat.patch
|
||||||
Patch9001: backport-Disallow-repeating-a-case-change-group.patch
|
Patch9001: backport-Disallow-repeating-a-case-change-group.patch
|
||||||
Patch9002: backport-increase_used_block_count_when_use_-put_mem_block.patch
|
Patch9002: backport-increase_used_block_count_when_use_-put_mem_block.patch
|
||||||
|
Patch9003: backport-Correct-stack-unwinding-inside-recursions-when-seein.patch
|
||||||
|
|
||||||
Requires: %{name}-atomic%{?_isa} = %{version}-%{release}
|
Requires: %{name}-atomic%{?_isa} = %{version}-%{release}
|
||||||
Requires: %{name}-chrono%{?_isa} = %{version}-%{release}
|
Requires: %{name}-chrono%{?_isa} = %{version}-%{release}
|
||||||
@ -597,6 +598,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x
|
|||||||
%patch9000 -p1
|
%patch9000 -p1
|
||||||
%patch9001 -p1
|
%patch9001 -p1
|
||||||
%patch9002 -p1
|
%patch9002 -p1
|
||||||
|
%patch9003 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
@ -1143,6 +1145,12 @@ fi
|
|||||||
%{_mandir}/man1/bjam.1*
|
%{_mandir}/man1/bjam.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 21 2021 zhangyiru <zhangyiru3@huawei.com> - 1.73.0-6
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: Correct stack unwinding inside recursions when seeing (*SKIP).
|
||||||
|
|
||||||
* Thu Oct 14 2021 zhangyiru <zhangyiru3@huawei.com> - 1.73.0-5
|
* Thu Oct 14 2021 zhangyiru <zhangyiru3@huawei.com> - 1.73.0-5
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user