[msan] Conditionally disable new() and delete() wrappers.

To be used with static libstdc++.

llvm-svn: 178866
This commit is contained in:
Evgeniy Stepanov 2013-04-05 12:03:47 +00:00
parent 7948c648bf
commit c7af878a01
2 changed files with 6 additions and 1 deletions

View File

@ -244,7 +244,8 @@ void __msan_init() {
InitTlsSize();
InitializeInterceptors();
ReplaceOperatorsNewAndDelete();
if (MSAN_REPLACE_OPERATORS_NEW_AND_DELETE)
ReplaceOperatorsNewAndDelete();
const char *msan_options = GetEnv("MSAN_OPTIONS");
InitializeFlags(&msan_flags, msan_options);
if (StackSizeIsUnlimited()) {

View File

@ -20,6 +20,10 @@
#include "msan_interface_internal.h"
#include "msan_flags.h"
#ifndef MSAN_REPLACE_OPERATORS_NEW_AND_DELETE
# define MSAN_REPLACE_OPERATORS_NEW_AND_DELETE 1
#endif
#define MEM_TO_SHADOW(mem) (((uptr)mem) & ~0x400000000000ULL)
#define MEM_TO_ORIGIN(mem) (MEM_TO_SHADOW(mem) + 0x200000000000ULL)
#define MEM_IS_APP(mem) ((uptr)mem >= 0x600000000000ULL)