@@ -48,11 +48,7 @@ _STL_DISABLE_CLANG_WARNINGS
4848#endif // !defined(_REGEX_MAX_COMPLEXITY_COUNT)
4949
5050#ifndef _REGEX_MAX_STACK_COUNT
51- #ifdef _WIN64
52- #define _REGEX_MAX_STACK_COUNT 600L // set to 0 to disable
53- #else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
5451#define _REGEX_MAX_STACK_COUNT 1000L // set to 0 to disable
55- #endif // ^^^ !defined(_WIN64) ^^^
5652#endif // !defined(_REGEX_MAX_STACK_COUNT)
5753
5854#ifndef _ENHANCED_REGEX_VISUALIZER
@@ -1675,7 +1671,7 @@ public:
16751671};
16761672
16771673enum class _Rx_unwind_ops {
1678- _After_assert = _N_end + 1,
1674+ _After_assert = 1,
16791675 _After_neg_assert,
16801676 _Disjunction_eval_alt_on_failure,
16811677 _Disjunction_eval_alt_always,
@@ -1814,7 +1810,7 @@ private:
18141810 vector<_Rx_state_frame_t<_It>> _Frames;
18151811 size_t _Frames_count;
18161812
1817- size_t _Push_frame(_Rx_unwind_ops _Code = {} , _Node_base* _Node = nullptr );
1813+ size_t _Push_frame(_Rx_unwind_ops _Code, _Node_base* _Node);
18181814 void _Pop_frame(size_t);
18191815
18201816 void _Increase_stack_usage_count();
@@ -3818,8 +3814,7 @@ template <class _BidIt, class _Elem, class _RxTraits, class _It, class _Alloc>
38183814bool _Matcher3<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Match_pat(_Node_base* _Nx) { // check for match
38193815 _Increase_stack_usage_count();
38203816
3821- bool _Failed = false;
3822- const size_t _Initial_frames_count = _Frames_count;
3817+ bool _Failed = false;
38233818
38243819 while (_Nx) {
38253820 do { // match current node
@@ -3994,7 +3989,7 @@ bool _Matcher3<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Match_pat(_Node_base* _N
39943989 auto& _Sav = _Loop_vals[_Node->_Loop_number];
39953990
39963991 if (_Node->_Simple_loop == 1) {
3997- _Sav._Loop_frame_idx = _Push_frame(_Rx_unwind_ops::_Do_nothing);
3992+ _Sav._Loop_frame_idx = _Push_frame(_Rx_unwind_ops::_Do_nothing, nullptr );
39983993 _Increase_complexity_count();
39993994 if (_Node->_Min > 0 || (_Greedy && !_Longest && _Node->_Max != 0)) { // try a rep first
40003995 _Sav._Loop_idx = 1;
@@ -4179,7 +4174,7 @@ bool _Matcher3<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Match_pat(_Node_base* _N
41794174 }
41804175 } while (_Nx);
41814176
4182- while (_Frames_count > _Initial_frames_count && !_Nx) {
4177+ while (_Frames_count > 0 && !_Nx) {
41834178 auto& _Frame = _Frames[--_Frames_count];
41844179
41854180 switch (_Frame._Code) {
0 commit comments