forked from boostorg/regex
Make backstep calculation non-recursive.
Refs https://github.com/boostorg/regex/pull/236.
This commit is contained in:
@ -137,3 +137,5 @@ compile test_windows_defs_4.cpp ;
|
||||
run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ;
|
||||
run issue227.cpp ;
|
||||
run issue232.cpp ;
|
||||
run lookbehind_recursion_stress_test.cpp ;
|
||||
|
||||
|
28
test/lookbehind_recursion_stress_test.cpp
Normal file
28
test/lookbehind_recursion_stress_test.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2024
|
||||
* John Maddock
|
||||
*
|
||||
* 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>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string s("(?<=(");
|
||||
s.append(1000, '|');
|
||||
s += "))";
|
||||
boost::regex rx(s);
|
||||
|
||||
s = "(?<=(a";
|
||||
for (unsigned i = 0; i < 1000; ++i)
|
||||
{
|
||||
s += "|a";
|
||||
}
|
||||
s += "))";
|
||||
boost::regex rx2(s);
|
||||
}
|
Reference in New Issue
Block a user