diff --git a/include/boost/regex/detail/regex_compile.hpp b/include/boost/regex/detail/regex_compile.hpp index 69c2c962..2a871733 100644 --- a/include/boost/regex/detail/regex_compile.hpp +++ b/include/boost/regex/detail/regex_compile.hpp @@ -1145,6 +1145,16 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression void BOOST_RE_CALL reg_expression::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces) @@ -1168,7 +1178,7 @@ void BOOST_RE_CALL reg_expression::fixup_apply(re_deta switch(ptr->type) { case re_detail::syntax_element_rep: - ((re_detail::re_jump*)ptr)->alt.p = (re_detail::re_syntax_base*)(base + ((re_detail::re_jump*)ptr)->alt.i); + ((re_detail::re_jump*)ptr)->alt.p = add_offset(base, ((re_detail::re_jump*)ptr)->alt.i); #ifdef BOOST_RE_DEBUG if((re_detail::padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p) && (((re_detail::re_jump*)ptr)->alt.p != b)) { @@ -1181,7 +1191,7 @@ void BOOST_RE_CALL reg_expression::fixup_apply(re_deta goto rebase; case re_detail::syntax_element_jump: case re_detail::syntax_element_alt: - ((re_detail::re_jump*)ptr)->alt.p = (re_detail::re_syntax_base*)(base + ((re_detail::re_jump*)ptr)->alt.i); + ((re_detail::re_jump*)ptr)->alt.p = add_offset(base, ((re_detail::re_jump*)ptr)->alt.i); #ifdef BOOST_RE_DEBUG if((re_detail::padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p) && (((re_detail::re_jump*)ptr)->alt.p != b)) { @@ -1203,7 +1213,7 @@ void BOOST_RE_CALL reg_expression::fixup_apply(re_deta goto rebase; default: rebase: - ptr->next.p = (re_detail::re_syntax_base*)(base + ptr->next.i); + ptr->next.p = add_offset(base, ptr->next.i); #ifdef BOOST_RE_DEBUG if((re_detail::padding_mask & (int)(ptr->next.p)) && (((re_detail::re_jump*)ptr)->alt.p != b)) {