diff --git a/include/boost/regex.hpp b/include/boost/regex.hpp index e03aafaf..3c2ae0a0 100644 --- a/include/boost/regex.hpp +++ b/include/boost/regex.hpp @@ -1075,6 +1075,7 @@ template match_results_base::match_results_base(const Allocator& a) { ref = (c_reference*)c_alloc(a).allocate(sizeof(sub_match) + sizeof(c_reference)); + BOOST_REGEX_NOEH_ASSERT(ref) #ifndef BOOST_NO_EXCEPTIONS try { @@ -1166,6 +1167,7 @@ void BOOST_REGEX_CALL match_results_base::set_size(size_typ if(ref->cmatches != n) { c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match) * n + sizeof(c_reference)); + BOOST_REGEX_NOEH_ASSERT(newref) #ifndef BOOST_NO_EXCEPTIONS try { @@ -1217,7 +1219,8 @@ void BOOST_REGEX_CALL match_results_base::set_size(size_typ { if(ref->cmatches != n) { - c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match) * n + sizeof(c_reference));; + c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match) * n + sizeof(c_reference)); + BOOST_REGEX_NOEH_ASSERT(newref) #ifndef BOOST_NO_EXCEPTIONS try{ #endif @@ -1332,6 +1335,7 @@ void BOOST_REGEX_CALL match_results_base::cow() if(ref->count > 1) { c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match) * ref->cmatches + sizeof(c_reference)); + BOOST_REGEX_NOEH_ASSERT(newref) #ifndef BOOST_NO_EXCEPTIONS try{ #endif @@ -1460,6 +1464,7 @@ match_results::match_results(const match_results::c_reference *> (m.ref->allocate(sizeof(sub_match) * m.ref->cmatches + sizeof(typename re_detail::match_results_base::c_reference))); + BOOST_REGEX_NOEH_ASSERT(this->ref) #ifndef BOOST_NO_EXCEPTIONS try{ #endif diff --git a/include/boost/regex/detail/regex_compile.hpp b/include/boost/regex/detail/regex_compile.hpp index e7bb5bd8..df3914c4 100644 --- a/include/boost/regex/detail/regex_compile.hpp +++ b/include/boost/regex/detail/regex_compile.hpp @@ -1172,6 +1172,7 @@ void BOOST_REGEX_CALL reg_expression::fixup_apply(re_d { #endif pb = a.allocate(cbraces); + BOOST_REGEX_NOEH_ASSERT(pb) for(unsigned i = 0; i < cbraces; ++i) pb[i] = false; diff --git a/include/boost/regex/detail/regex_kmp.hpp b/include/boost/regex/detail/regex_kmp.hpp index f59d49e5..3572858b 100644 --- a/include/boost/regex/detail/regex_kmp.hpp +++ b/include/boost/regex/detail/regex_kmp.hpp @@ -67,6 +67,7 @@ kmp_info* kmp_compile(iterator first, iterator last, charT, Trans transla // allocate struct and fill it in: // kmp_info* pinfo = reinterpret_cast*>(atype(a).allocate(size)); + BOOST_REGEX_NOEH_ASSERT(pinfo) pinfo->size = size; pinfo->len = m; charT* p = reinterpret_cast(reinterpret_cast(pinfo) + sizeof(kmp_info) + sizeof(int)*(m+1)); diff --git a/include/boost/regex/detail/regex_match.hpp b/include/boost/regex/detail/regex_match.hpp index 5e23d11d..fbd37971 100644 --- a/include/boost/regex/detail/regex_match.hpp +++ b/include/boost/regex/detail/regex_match.hpp @@ -215,7 +215,9 @@ void _priv_match_data::set_accumulator_size(unsigned int si m_free(); caccumulators = size; accumulators = i_alloc(temp_match.allocator()).allocate(caccumulators); + BOOST_REGEX_NOEH_ASSERT(accumulators) loop_starts = it_alloc(temp_match.allocator()).allocate(caccumulators); + BOOST_REGEX_NOEH_ASSERT(loop_starts) for(unsigned i = 0; i < caccumulators; ++i) new (loop_starts + i) iterator(); } diff --git a/include/boost/regex/detail/regex_raw_buffer.hpp b/include/boost/regex/detail/regex_raw_buffer.hpp index 15e4b974..0dfb4ec6 100644 --- a/include/boost/regex/detail/regex_raw_buffer.hpp +++ b/include/boost/regex/detail/regex_raw_buffer.hpp @@ -179,6 +179,7 @@ raw_storage::raw_storage(const Allocator& a) : alloc_inst(a) { start = end = alloc_inst.allocate(1024); + BOOST_REGEX_NOEH_ASSERT(start) alloc_inst.last = start + 1024; } @@ -187,6 +188,7 @@ raw_storage::raw_storage(size_type n, const Allocator& a) : alloc_inst(a) { start = end = alloc_inst.allocate(n); + BOOST_REGEX_NOEH_ASSERT(start) alloc_inst.last = start + n; } @@ -208,6 +210,7 @@ void BOOST_REGEX_CALL raw_storage::resize(size_type n) // allocate and copy data: register unsigned char* ptr = alloc_inst.allocate(newsize); + BOOST_REGEX_NOEH_ASSERT(ptr) std::memcpy(ptr, start, datasize); // get rid of old buffer: diff --git a/include/boost/regex/detail/regex_stack.hpp b/include/boost/regex/detail/regex_stack.hpp index db9e7f93..c741d989 100644 --- a/include/boost/regex/detail/regex_stack.hpp +++ b/include/boost/regex/detail/regex_stack.hpp @@ -85,6 +85,7 @@ public: node* BOOST_REGEX_CALL get_node() { node* new_stack = reinterpret_cast(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size)); + BOOST_REGEX_NOEH_ASSERT(new_stack) new_stack->last = reinterpret_cast(new_stack+1); new_stack->start = new_stack->end = new_stack->last + block_size; new_stack->next = 0;