From 647d602a3563305209487c7ac0f1f2ad120db79a Mon Sep 17 00:00:00 2001 From: anonymous Date: Tue, 4 Jan 2011 09:08:40 +0600 Subject: fix for COMPILER-8905: operator new should throw std::bad_alloc if new handler is not set --- src/memory.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/memory.cc b/src/memory.cc index 8e5574a..f8719e7 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -29,7 +29,11 @@ void * operator new(size_t size) { void * mem = malloc(size); while(mem == NULL) { - new_handl(); + if(new_handl != NULL) { + new_handl(); + } else { + throw std::bad_alloc(); + } mem = malloc(size); } -- cgit v1.2.3