Skip to content

Commit

Permalink
Tentative fix for #227. (#230)
Browse files Browse the repository at this point in the history
Fixes #227.
  • Loading branch information
jzmaddock authored Nov 6, 2024
1 parent bd0e76f commit 9a8d2b1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/boost/regex/v5/perl_matcher_non_recursive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 19 additions & 0 deletions test/issue227.cpp
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 9a8d2b1

Please sign in to comment.