[msan] Add missing visibility attribute to MSan new/delete interceptors.

llvm-svn: 197809
This commit is contained in:
Evgeniy Stepanov 2013-12-20 13:18:07 +00:00
parent 42cebb00da
commit 09021e02bc
1 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "msan.h"
#include "sanitizer_common/sanitizer_interception.h"
#if MSAN_REPLACE_OPERATORS_NEW_AND_DELETE
@ -37,18 +38,26 @@ namespace std {
GET_MALLOC_STACK_TRACE; \
return MsanReallocate(&stack, 0, size, sizeof(u64), false)
INTERCEPTOR_ATTRIBUTE
void *operator new(size_t size) { OPERATOR_NEW_BODY; }
INTERCEPTOR_ATTRIBUTE
void *operator new[](size_t size) { OPERATOR_NEW_BODY; }
INTERCEPTOR_ATTRIBUTE
void *operator new(size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY; }
INTERCEPTOR_ATTRIBUTE
void *operator new[](size_t size, std::nothrow_t const&) { OPERATOR_NEW_BODY; }
#define OPERATOR_DELETE_BODY \
GET_MALLOC_STACK_TRACE; \
if (ptr) MsanDeallocate(&stack, ptr)
INTERCEPTOR_ATTRIBUTE
void operator delete(void *ptr) { OPERATOR_DELETE_BODY; }
INTERCEPTOR_ATTRIBUTE
void operator delete[](void *ptr) { OPERATOR_DELETE_BODY; }
INTERCEPTOR_ATTRIBUTE
void operator delete(void *ptr, std::nothrow_t const&) { OPERATOR_DELETE_BODY; }
INTERCEPTOR_ATTRIBUTE
void operator delete[](void *ptr, std::nothrow_t const&) {
OPERATOR_DELETE_BODY;
}