From 1dc081e1c2a4dd41e48ff0a69b46b8502fbc504f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 3 May 2004 11:24:58 +0000 Subject: [PATCH] Fixed problem with wide character optimisations, changed asserts on pointers (HP-specific workaround). [SVN r22721] --- .../boost/regex/v4/perl_matcher_common.hpp | 4 ++-- .../regex/v4/perl_matcher_non_recursive.hpp | 20 +++++++++---------- include/boost/regex/v4/regex_compile.hpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 6ec7662c..7a454047 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -78,11 +78,11 @@ void perl_matcher::estimate_max_sta difference_type dist = boost::re_detail::distance(base, last); traits_size_type states = static_cast(re.size()); states *= states; - difference_type lim = (std::numeric_limits::max)() - 1000 - states; + difference_type lim = (std::numeric_limits::max)() - 100000 - states; if(dist > (difference_type)(lim / states)) max_state_count = lim; else - max_state_count = 1000 + states * dist; + max_state_count = 100000 + states * dist; } template void perl_matcher::estimate_max_state_count(void*) diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 297548c2..a730ae26 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -927,8 +927,8 @@ bool perl_matcher::unwind_greedy_si const re_repeat* rep = pmp->rep; unsigned count = pmp->count; - assert(rep->next.p); - assert(rep->alt.p); + assert(rep->next.p != 0); + assert(rep->alt.p != 0); count -= rep->min; @@ -977,8 +977,8 @@ bool perl_matcher::unwind_slow_dot_ const re_repeat* rep = pmp->rep; unsigned count = pmp->count; assert(rep->type == syntax_element_dot_rep); - assert(rep->next.p); - assert(rep->alt.p); + assert(rep->next.p != 0); + assert(rep->alt.p != 0); assert(rep->next.p->type == syntax_element_wild); assert(count < rep->max); @@ -1095,8 +1095,8 @@ bool perl_matcher::unwind_char_repe position = pmp->last_position; assert(rep->type == syntax_element_char_rep); - assert(rep->next.p); - assert(rep->alt.p); + assert(rep->next.p != 0); + assert(rep->alt.p != 0); assert(rep->next.p->type == syntax_element_literal); assert(count < rep->max); @@ -1159,8 +1159,8 @@ bool perl_matcher::unwind_short_set position = pmp->last_position; assert(rep->type == syntax_element_short_set_rep); - assert(rep->next.p); - assert(rep->alt.p); + assert(rep->next.p != 0); + assert(rep->alt.p != 0); assert(rep->next.p->type == syntax_element_set); assert(count < rep->max); @@ -1223,8 +1223,8 @@ bool perl_matcher::unwind_long_set_ position = pmp->last_position; assert(rep->type == syntax_element_long_set_rep); - assert(rep->next.p); - assert(rep->alt.p); + assert(rep->next.p != 0); + assert(rep->alt.p != 0); assert(rep->next.p->type == syntax_element_long_set); assert(position != last); assert(count < rep->max); diff --git a/include/boost/regex/v4/regex_compile.hpp b/include/boost/regex/v4/regex_compile.hpp index 25fb41b8..d6e88029 100644 --- a/include/boost/regex/v4/regex_compile.hpp +++ b/include/boost/regex/v4/regex_compile.hpp @@ -1066,7 +1066,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression sizeof(charT)) + if(len > sizeof(charT) * 2) singleton = false; std::memcpy(reinterpret_cast(data.extend(len)), s.c_str(), len); singles.pop();