The Standard C++ library |
The following operator new signatures are affected:
void *operator new(unsigned int aSize); void *operator new[](unsigned int aSize);
The following code snippet is an example that depicts the problem:
class Dummy { }; void *operator new(unsigned int aSize) { void* __y = malloc(aSize); // try to simulate bad alloc if (__y == 0) { throw Dummy(); //this will result in a crash } return __y; }