- Fixes for boost.regex (rev 42674).

This commit is contained in:
Petr Machata 2008-01-16 16:27:11 +00:00
parent 46b662e322
commit 8b63e4c402
2 changed files with 46 additions and 1 deletions

40
boost-regex.patch Normal file
View File

@ -0,0 +1,40 @@
*** boost/regex/v4/basic_regex_parser.hpp.orig 2008-01-14 12:53:01.000000000 -0600
--- boost/regex/v4/basic_regex_parser.hpp 2008-01-14 12:57:25.000000000 -0600
*************** bool basic_regex_parser<charT, traits>::
*** 777,782 ****
--- 777,783 ----
case syntax_element_restart_continue:
case syntax_element_jump:
case syntax_element_startmark:
+ case syntax_element_backstep:
// can't legally repeat any of the above:
fail(regex_constants::error_badrepeat, m_position - m_base);
return false;
*************** bool basic_regex_parser<charT, traits>::
*** 1862,1867 ****
--- 1863,1869 ----
if(markid == -4)
{
re_syntax_base* b = this->getaddress(expected_alt_point);
+ // Make sure we have exactly one alternative following this state:
if(b->type != syntax_element_alt)
{
re_alt* alt = static_cast<re_alt*>(this->insert_state(expected_alt_point, syntax_element_alt, sizeof(re_alt)));
*************** bool basic_regex_parser<charT, traits>::
*** 1872,1877 ****
--- 1874,1888 ----
fail(regex_constants::error_bad_pattern, m_position - m_base);
return false;
}
+ // check for invalid repetition of next state:
+ b = this->getaddress(expected_alt_point);
+ b = this->getaddress(static_cast<re_alt*>(b)->next.i, b);
+ if((b->type != syntax_element_assert_backref)
+ && (b->type != syntax_element_startmark))
+ {
+ fail(regex_constants::error_badrepeat, m_position - m_base);
+ return false;
+ }
}
//
// append closing parenthesis state:

View File

@ -1,7 +1,7 @@
Name: boost
Summary: The Boost C++ Libraries
Version: 1.34.1
Release: 5%{?dist}
Release: 6%{?dist}
License: Boost Software License (GPL-Compatible, Free Software License)
URL: http://www.boost.org/
Group: System Environment/Libraries
@ -25,6 +25,7 @@ Patch0: boost-configure.patch
Patch1: boost-gcc-soname.patch
Patch2: boost-use-rpm-optflags.patch
Patch3: boost-run-tests.patch
Patch4: boost-regex.patch
%description
Boost provides free peer-reviewed portable C++ source libraries. The
@ -69,6 +70,7 @@ rm -rf %{buildroot}
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%build
BOOST_ROOT=`pwd`
@ -199,6 +201,9 @@ rm -rf $RPM_BUILD_ROOT
%doc %{_docdir}/boost-%{version}
%changelog
* Mon Jan 14 2008 Benjamin Kosnik <bkoz@redhat.com> 1.34.1-6
- Fixes for boost.regex (rev 42674).
* Wed Sep 19 2007 Benjamin Kosnik <bkoz@redhat.com> 1.34.1-5
- (#283771: Linking against boost libraries fails).