Compare commits
12 Commits
2f05304772
...
9de55bc3ff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9de55bc3ff | ||
|
|
2cb662a3cb | ||
|
|
8a396af84b | ||
|
|
3f35645cbe | ||
|
|
3e2ad10ff1 | ||
|
|
60fa0ae061 | ||
|
|
e386591796 | ||
|
|
c8e96fd0cc | ||
|
|
26e2accfef | ||
|
|
dc06bf34f6 | ||
|
|
128c3dfbb1 | ||
|
|
ed76d52cfa |
@ -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
|
||||
|
||||
42
backport-Disallow-repeating-a-case-change-group.patch
Normal file
42
backport-Disallow-repeating-a-case-change-group.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 370afe3f446c69a7ccc4c09f056272346afc264b Mon Sep 17 00:00:00 2001
|
||||
From: zhangyiru <zhangyiru3@huawei.com>
|
||||
Date: Thu, 14 Oct 2021 15:55:56 -0400
|
||||
Subject: [PATCH] Disallow repeating a case-change group
|
||||
|
||||
fix assertion failed: https://github.com/boostorg/regex/issues/151
|
||||
|
||||
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
||||
---
|
||||
boost/regex/v4/basic_regex_parser.hpp | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp
|
||||
index 6c7065f05..2ce615943 100644
|
||||
--- a/boost/regex/v4/basic_regex_parser.hpp
|
||||
+++ b/boost/regex/v4/basic_regex_parser.hpp
|
||||
@@ -1042,6 +1042,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
case syntax_element_jump:
|
||||
case syntax_element_startmark:
|
||||
case syntax_element_backstep:
|
||||
+ case syntax_element_toggle_case:
|
||||
// can't legally repeat any of the above:
|
||||
fail(regex_constants::error_badrepeat, m_position - m_base);
|
||||
return false;
|
||||
@@ -3116,7 +3117,13 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st
|
||||
m_alt_jumps.pop_back();
|
||||
this->m_pdata->m_data.align();
|
||||
re_jump* jmp = static_cast<re_jump*>(this->getaddress(jump_offset));
|
||||
- BOOST_ASSERT(jmp->type == syntax_element_jump);
|
||||
+ if (jmp->type != syntax_element_jump)
|
||||
+ {
|
||||
+ // Something really bad happened, this used to be an assert,
|
||||
+ // but we'll make it an error just in case we should ever get here.
|
||||
+ fail(regex_constants::error_unknown, this->m_position - this->m_base, "Internal logic failed while compiling the expression, probably you added a repeat to something non-repeatable!");
|
||||
+ return false;
|
||||
+ }
|
||||
jmp->alt.i = this->m_pdata->m_data.size() - jump_offset;
|
||||
}
|
||||
return true;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
From db3c106f1e80e67f9ed80ee276c5e080519290ad Mon Sep 17 00:00:00 2001
|
||||
From: zhangyiru <zhangyiru3@huawei.com>
|
||||
Date: Thu, 14 Oct 2021 15:39:19 -0400
|
||||
Subject: [PATCH] increase used_block_count when use_ put_mem_block
|
||||
|
||||
fix memleak problem: https://github.com/boostorg/regex/issues/153
|
||||
|
||||
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
||||
---
|
||||
boost/regex/v4/perl_matcher_non_recursive.hpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/boost/regex/v4/perl_matcher_non_recursive.hpp b/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||
index eb470a78d..54ce751da 100644
|
||||
--- a/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||
+++ b/boost/regex/v4/perl_matcher_non_recursive.hpp
|
||||
@@ -1363,6 +1363,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_repeater_counter(bool
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_extra_block(bool)
|
||||
{
|
||||
+ ++used_block_count;
|
||||
saved_extra_block* pmp = static_cast<saved_extra_block*>(m_backup_state);
|
||||
void* condemmed = m_stack_base;
|
||||
m_stack_base = pmp->base;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
74
boost.spec
74
boost.spec
@ -22,9 +22,9 @@
|
||||
|
||||
Name: boost
|
||||
Version: 1.73.0
|
||||
Release: 3
|
||||
Release: 7
|
||||
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
|
||||
Source0: https://sourceforge.net/projects/boost/files/boost/%{version}/%{toplev_dirname}.tar.bz2
|
||||
Source1: libboost_thread.so
|
||||
@ -44,6 +44,11 @@ Patch3: boost-1.58.0-pool-test_linking.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1318383
|
||||
Patch4: boost-1.66.0-no-rpath.patch
|
||||
|
||||
Patch9000: regex-fix-dead-loop-in-parse_repeat.patch
|
||||
Patch9001: backport-Disallow-repeating-a-case-change-group.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}-chrono%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-container%{?_isa} = %{version}-%{release}
|
||||
@ -590,6 +595,10 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x
|
||||
%patch2 -p0
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch9000 -p1
|
||||
%patch9001 -p1
|
||||
%patch9002 -p1
|
||||
%patch9003 -p1
|
||||
|
||||
%build
|
||||
%if %{with python3}
|
||||
@ -784,7 +793,6 @@ echo ============================= install Boost.Build ==================
|
||||
|
||||
install -m 755 %{_builddir}/%{name}_%{version_enc}/tools/build/b2 $RPM_BUILD_ROOT%{_bindir}/bjam
|
||||
%{__install} -p -m 644 %{SOURCE2} -D $RPM_BUILD_ROOT%{_mandir}/man1/bjam.1
|
||||
cp %{_libdir}/libboost_*.so.1.72.* $RPM_BUILD_ROOT%{_libdir}
|
||||
)
|
||||
|
||||
echo ============================= install Boost.QuickBook ==================
|
||||
@ -877,69 +885,55 @@ fi
|
||||
%files contract
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_contract.so.%{sonamever}
|
||||
%{_libdir}/libboost_contract.so.1.72.*
|
||||
|
||||
%files atomic
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_atomic.so.%{sonamever}
|
||||
%{_libdir}/libboost_atomic.so.1.72.*
|
||||
|
||||
%files chrono
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_chrono.so.%{sonamever}
|
||||
%{_libdir}/libboost_chrono.so.1.72.*
|
||||
|
||||
%files container
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_container.so.%{sonamever}
|
||||
%{_libdir}/libboost_container.so.1.72.*
|
||||
|
||||
%files context
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_context.so.%{sonamever}
|
||||
%{_libdir}/libboost_context.so.1.72.*
|
||||
|
||||
%files coroutine
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_coroutine.so.%{sonamever}
|
||||
%{_libdir}/libboost_coroutine.so.1.72.*
|
||||
|
||||
%files date-time
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_date_time.so.%{sonamever}
|
||||
%{_libdir}/libboost_date_time.so.1.72.*
|
||||
|
||||
%files fiber
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_fiber.so.%{sonamever}
|
||||
%{_libdir}/libboost_fiber.so.1.72.*
|
||||
|
||||
%files filesystem
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_filesystem.so.%{sonamever}
|
||||
%{_libdir}/libboost_filesystem.so.1.72.*
|
||||
|
||||
%files graph
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_graph.so.%{sonamever}
|
||||
%{_libdir}/libboost_graph.so.1.72.*
|
||||
|
||||
%files iostreams
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_iostreams.so.%{sonamever}
|
||||
%{_libdir}/libboost_iostreams.so.1.72.*
|
||||
|
||||
%files locale
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_locale.so.%{sonamever}
|
||||
%{_libdir}/libboost_locale.so.1.72.*
|
||||
|
||||
%files log
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_log.so.%{sonamever}
|
||||
%{_libdir}/libboost_log.so.1.72.*
|
||||
%{_libdir}/libboost_log_setup.so.%{sonamever}
|
||||
%{_libdir}/libboost_log_setup.so.1.72.*
|
||||
|
||||
%files math
|
||||
%license LICENSE_1_0.txt
|
||||
@ -950,13 +944,6 @@ fi
|
||||
%{_libdir}/libboost_math_tr1f.so.%{sonamever}
|
||||
%{_libdir}/libboost_math_tr1l.so.%{sonamever}
|
||||
|
||||
%{_libdir}/libboost_math_c99.so.1.72.*
|
||||
%{_libdir}/libboost_math_c99f.so.1.72.*
|
||||
%{_libdir}/libboost_math_c99l.so.1.72.*
|
||||
%{_libdir}/libboost_math_tr1.so.1.72.*
|
||||
%{_libdir}/libboost_math_tr1f.so.1.72.*
|
||||
%{_libdir}/libboost_math_tr1l.so.1.72.*
|
||||
|
||||
%files nowide
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_nowide.so.%{sonamever}
|
||||
@ -966,12 +953,10 @@ fi
|
||||
%files numpy3
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_numpy%{python3_lib_version}.so.%{sonamever}
|
||||
%{_libdir}/libboost_numpy37.so.1.72.*
|
||||
|
||||
%files python3
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_python%{python3_lib_version}.so.%{sonamever}
|
||||
%{_libdir}/libboost_python37.so.1.72.*
|
||||
|
||||
%files python3-devel
|
||||
%license LICENSE_1_0.txt
|
||||
@ -984,64 +969,49 @@ fi
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_prg_exec_monitor.so.%{sonamever}
|
||||
%{_libdir}/libboost_unit_test_framework.so.%{sonamever}
|
||||
%{_libdir}/libboost_prg_exec_monitor.so.1.72.*
|
||||
%{_libdir}/libboost_unit_test_framework.so.1.72.*
|
||||
|
||||
%files program-options
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_program_options.so.%{sonamever}
|
||||
%{_libdir}/libboost_program_options.so.1.72.*
|
||||
|
||||
%files random
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_random.so.%{sonamever}
|
||||
%{_libdir}/libboost_random.so.1.72.*
|
||||
|
||||
%files regex
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_regex.so.%{sonamever}
|
||||
%{_libdir}/libboost_regex.so.1.72.*
|
||||
|
||||
%files serialization
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_serialization.so.%{sonamever}
|
||||
%{_libdir}/libboost_wserialization.so.%{sonamever}
|
||||
|
||||
%{_libdir}/libboost_serialization.so.1.72.*
|
||||
%{_libdir}/libboost_wserialization.so.1.72.*
|
||||
%files stacktrace
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_stacktrace_addr2line.so.%{sonamever}
|
||||
%{_libdir}/libboost_stacktrace_basic.so.%{sonamever}
|
||||
%{_libdir}/libboost_stacktrace_noop.so.%{sonamever}
|
||||
|
||||
%{_libdir}/libboost_stacktrace_addr2line.so.1.72.*
|
||||
%{_libdir}/libboost_stacktrace_basic.so.1.72.*
|
||||
%{_libdir}/libboost_stacktrace_noop.so.1.72.*
|
||||
%files system
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_system.so.%{sonamever}
|
||||
%{_libdir}/libboost_system.so.1.72.*
|
||||
|
||||
%files thread
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_thread.so.%{sonamever}
|
||||
%{_libdir}/libboost_thread.so.1.72.*
|
||||
|
||||
%files timer
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_timer.so.%{sonamever}
|
||||
%{_libdir}/libboost_timer.so.1.72.*
|
||||
|
||||
%files type_erasure
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_type_erasure.so.%{sonamever}
|
||||
%{_libdir}/libboost_type_erasure.so.1.72.*
|
||||
|
||||
%files wave
|
||||
%license LICENSE_1_0.txt
|
||||
%{_libdir}/libboost_wave.so.%{sonamever}
|
||||
%{_libdir}/libboost_wave.so.1.72.*
|
||||
|
||||
%files help
|
||||
%doc %{boost_docdir}/*
|
||||
@ -1136,6 +1106,28 @@ fi
|
||||
%{_mandir}/man1/bjam.1*
|
||||
|
||||
%changelog
|
||||
* Mon Apr 25 2022 chendexi <chendexi@kylinos.cn> - 1.73.0-7
|
||||
- Delete useless old version dynamic library
|
||||
|
||||
* 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
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:increase used_block_count when use put_mem_block
|
||||
Disallow repeating a case-change group
|
||||
|
||||
* Tue Jun 22 2021 Xu Huijie <xuhuijie2@huawei.com> - 1.73.0-4
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix dead loop in parse_repeat()
|
||||
|
||||
* Wed Dec 16 2020 xinghe <xinghe1@huawei.com> - 1.73.0-3
|
||||
- correct license
|
||||
|
||||
|
||||
33
regex-fix-dead-loop-in-parse_repeat.patch
Normal file
33
regex-fix-dead-loop-in-parse_repeat.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 91107fe78a290a7d25a042fec09ea89f14f480d9 Mon Sep 17 00:00:00 2001
|
||||
From: xuhuijie <xuhuijie2@huawei.com>
|
||||
Date: Wed, 16 Jun 2021 15:47:22 +0800
|
||||
Subject: [PATCH] regex: fix dead loop in parse_repea
|
||||
There is a bug in parse_repeat(), after deal with comment the
|
||||
contin value will be always true. So we enter a dead loop. To deal with this,
|
||||
we assign contin to false each time we enter the loop.
|
||||
Testcase: boost::regex(std::string("1?+(?#)1"))
|
||||
|
||||
Signed-off-by: Xu Huijie <xuhuijie2@huawei.com>
|
||||
---
|
||||
boost/regex/v4/basic_regex_parser.hpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp
|
||||
index 6c7065f05..de22f7000 100644
|
||||
--- a/boost/regex/v4/basic_regex_parser.hpp
|
||||
+++ b/boost/regex/v4/basic_regex_parser.hpp
|
||||
@@ -1080,9 +1080,10 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
// Check for illegal following quantifier, we have to do this here, because
|
||||
// the extra states we insert below circumvents our usual error checking :-(
|
||||
//
|
||||
- bool contin = false;
|
||||
+ bool contin;
|
||||
do
|
||||
{
|
||||
+ contin = false;
|
||||
if ((this->flags() & (regbase::main_option_type | regbase::mod_x | regbase::no_perl_ex)) == regbase::mod_x)
|
||||
{
|
||||
// whitespace skip:
|
||||
--
|
||||
2.23.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user