diff --git a/include/boost/regex/v5/perl_matcher_common.hpp b/include/boost/regex/v5/perl_matcher_common.hpp index d331a1ed7..dcce9e6ac 100644 --- a/include/boost/regex/v5/perl_matcher_common.hpp +++ b/include/boost/regex/v5/perl_matcher_common.hpp @@ -591,32 +591,14 @@ bool perl_matcher::match_backref() }while((r.first != r.second) && ((*m_presult)[index].matched != true)); } - if((m_match_flags & match_perl) && !(*m_presult)[index].matched){ + if((m_match_flags & match_perl) && !(*m_presult)[index].matched) return false; - } - - auto const& submatch = (*m_presult)[index]; - BidiIterator i = submatch.get_first(); - BidiIterator j = submatch.get_second(); - - { - auto ic = i; - auto jc = j; - auto curr = 0; - while(ic != jc) { - ++ic; - if(++curr >= 5000) { - boost::throw_exception(std::runtime_error("lmao no way bro, it's over")); - } - } - } + BidiIterator i = (*m_presult)[index].first; + BidiIterator j = (*m_presult)[index].second; while(i != j) { - if((position == last)) - return false; - - if((traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) + if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) return false; ++i; ++position; diff --git a/include/boost/regex/v5/perl_matcher_non_recursive.hpp b/include/boost/regex/v5/perl_matcher_non_recursive.hpp index 28d6c462f..6ee6f6bf5 100644 --- a/include/boost/regex/v5/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v5/perl_matcher_non_recursive.hpp @@ -1204,6 +1204,8 @@ bool perl_matcher::skip_until_paren(int index, else if(pstate->type == syntax_element_startmark) { int idx = static_cast(pstate)->index; + if( idx == -5 ) + match_startmark(); pstate = pstate->next.p; skip_until_paren(idx, false); continue; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 409f56456..1fd6cc3d0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -135,4 +135,4 @@ compile test_windows_defs_3.cpp ; compile test_windows_defs_4.cpp ; run issue153.cpp : : : "msvc:-STACK:2097152" ; -# run issue227.cpp ; +run issue227.cpp ;