Added more error checking for no-eh builds.

[SVN r12870]
This commit is contained in:
John Maddock
2002-02-21 11:30:41 +00:00
parent b55cce9a42
commit 11accf4a8b
6 changed files with 14 additions and 1 deletions

View File

@ -1172,6 +1172,7 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_d
{
#endif
pb = a.allocate(cbraces);
BOOST_REGEX_NOEH_ASSERT(pb)
for(unsigned i = 0; i < cbraces; ++i)
pb[i] = false;

View File

@ -67,6 +67,7 @@ kmp_info<charT>* kmp_compile(iterator first, iterator last, charT, Trans transla
// allocate struct and fill it in:
//
kmp_info<charT>* pinfo = reinterpret_cast<kmp_info<charT>*>(atype(a).allocate(size));
BOOST_REGEX_NOEH_ASSERT(pinfo)
pinfo->size = size;
pinfo->len = m;
charT* p = reinterpret_cast<charT*>(reinterpret_cast<char*>(pinfo) + sizeof(kmp_info<charT>) + sizeof(int)*(m+1));

View File

@ -215,7 +215,9 @@ void _priv_match_data<iterator, Allocator>::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();
}

View File

@ -179,6 +179,7 @@ raw_storage<Allocator>::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<Allocator>::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<Allocator>::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:

View File

@ -85,6 +85,7 @@ public:
node* BOOST_REGEX_CALL get_node()
{
node* new_stack = reinterpret_cast<node*>(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size));
BOOST_REGEX_NOEH_ASSERT(new_stack)
new_stack->last = reinterpret_cast<T*>(new_stack+1);
new_stack->start = new_stack->end = new_stack->last + block_size;
new_stack->next = 0;