|
20 | 20 | #ifndef BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP |
21 | 21 | #define BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP |
22 | 22 |
|
| 23 | +#include <boost/regex/v4/indexed_bit_flag.hpp> |
| 24 | + |
23 | 25 | #ifdef BOOST_MSVC |
24 | 26 | #pragma warning(push) |
25 | 27 | #pragma warning(disable: 4103) |
@@ -239,7 +241,7 @@ class basic_regex_creator |
239 | 241 | bool m_icase; // true for case insensitive matches |
240 | 242 | unsigned m_repeater_id; // the state_id of the next repeater |
241 | 243 | bool m_has_backrefs; // true if there are actually any backrefs |
242 | | - unsigned m_backrefs; // bitmask of permitted backrefs |
| 244 | + indexed_bit_flag m_backrefs; // bitmask of permitted backrefs |
243 | 245 | boost::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for; |
244 | 246 | bool m_has_recursions; // set when we have recursive expresisons to fixup |
245 | 247 | std::vector<unsigned char> m_recursion_checks; // notes which recursions we've followed while analysing this expression |
@@ -267,7 +269,7 @@ class basic_regex_creator |
267 | 269 |
|
268 | 270 | template <class charT, class traits> |
269 | 271 | basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits>* data) |
270 | | - : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false) |
| 272 | + : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_has_recursions(false) |
271 | 273 | { |
272 | 274 | m_pdata->m_data.clear(); |
273 | 275 | m_pdata->m_status = ::boost::regex_constants::error_ok; |
@@ -763,7 +765,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state) |
763 | 765 | if(idx < 0) |
764 | 766 | { |
765 | 767 | idx = -idx-1; |
766 | | - if(idx >= 10000) |
| 768 | + if(idx >= hash_value_mask) |
767 | 769 | { |
768 | 770 | idx = m_pdata->get_id(idx); |
769 | 771 | if(idx <= 0) |
@@ -795,7 +797,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state) |
795 | 797 | bool ok = false; |
796 | 798 | re_syntax_base* p = base; |
797 | 799 | std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i; |
798 | | - if(idx > 10000) |
| 800 | + if(idx >= hash_value_mask) |
799 | 801 | { |
800 | 802 | // |
801 | 803 | // There may be more than one capture group with this hash, just do what Perl |
|
0 commit comments