Added interceptions for:
operator new(unsigned, std::nothrow_t const&)
operator new[](unsigned, std::nothrow_t const&)
because they weren't being intercepted, and called malloc(), which caused bogus
mismatch errors.
Added a regression test for it, too.
MERGE TO STABLE (although the change to vg_replace_malloc.c won't quite be a
cut and paste job, because of prior changes made to it in the head
but not the stable branch; merge will still be easy, though)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1899 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_replace_malloc.c b/coregrind/vg_replace_malloc.c
index 9c3ca25..7e3d76e 100644
--- a/coregrind/vg_replace_malloc.c
+++ b/coregrind/vg_replace_malloc.c
@@ -160,11 +160,18 @@
MALLOC_TRACE(" = %p\n", v ); \
return v; \
}
-ALLOC( malloc, SK_(malloc) );
-ALLOC( __builtin_new, SK_(__builtin_new) );
-ALLOC( _Znwj, SK_(__builtin_new) );
-ALLOC( __builtin_vec_new, SK_(__builtin_vec_new) );
-ALLOC( _Znaj, SK_(__builtin_vec_new) );
+ALLOC( malloc, SK_(malloc) );
+ALLOC( __builtin_new, SK_(__builtin_new) );
+ALLOC( _Znwj, SK_(__builtin_new) );
+
+// operator new(unsigned, std::nothrow_t const&)
+ALLOC( _ZnwjRKSt9nothrow_t, SK_(__builtin_new) );
+
+ALLOC( __builtin_vec_new, SK_(__builtin_vec_new) );
+ALLOC( _Znaj, SK_(__builtin_vec_new) );
+
+// operator new[](unsigned, std::nothrow_t const&
+ALLOC( _ZnajRKSt9nothrow_t, SK_(__builtin_vec_new) );
#define FREE(fff, vgfff) \
void fff ( void* p ) \