Compare commits

...

3 Commits

Author SHA1 Message Date
3a50c6828c Restrict fix to where we really need it. 2024-11-04 18:12:47 +00:00
be12f75b22 Tidy up code, add test. 2024-11-04 17:05:08 +00:00
39ee6e36b0 Tentative fix for #227. 2024-11-04 16:38:46 +00:00
3 changed files with 24 additions and 1 deletions

View File

@ -1204,7 +1204,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index,
else if(pstate->type == syntax_element_startmark)
{
int idx = static_cast<const re_brace*>(pstate)->index;
pstate = pstate->next.p;
if(idx > 0)
match_startmark();
else
pstate = pstate->next.p;
skip_until_paren(idx, false);
continue;
}

View File

@ -135,3 +135,4 @@ compile test_windows_defs_3.cpp ;
compile test_windows_defs_4.cpp ;
run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ;
run issue227.cpp ;

19
test/issue227.cpp Normal file
View File

@ -0,0 +1,19 @@
/*
* Copyright (c) 2024
* Christian Mazakas
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex.hpp>
#include <string>
int main() {
boost::regex rx("(*ACCEPT)*+\\1((*ACCEPT)*+\\K)");
std::string str = "Z";
boost::smatch what;
boost::regex_search(str, what, rx, boost::match_default | boost::match_partial);
}