Index: lib/asan/asan_new_delete.cc =================================================================== --- lib/asan/asan_new_delete.cc +++ lib/asan/asan_new_delete.cc @@ -69,6 +69,19 @@ enum class align_val_t: size_t {}; } // namespace std +//Windows builds do not define MemalignFromLocalPool +#if SANITIZER_WINDOWS +#define OPERATOR_NEW_BODY(type, nothrow) \ + GET_STACK_TRACE_MALLOC;\ + void *res = asan_memalign(0, size, &stack, type);\ + if (!nothrow && UNLIKELY(!res)) ReportOutOfMemory(size, &stack);\ + return res; +#define OPERATOR_NEW_BODY_ALIGN(type, nothrow) \ + GET_STACK_TRACE_MALLOC;\ + void *res = asan_memalign((uptr)align, size, &stack, type);\ + if (!nothrow && UNLIKELY(!res)) ReportOutOfMemory(size, &stack);\ + return res; +#else // TODO(alekseyshl): throw std::bad_alloc instead of dying on OOM. // For local pool allocation, align to SHADOW_GRANULARITY to match asan // allocator behavior. @@ -92,7 +105,7 @@ void *res = asan_memalign((uptr)align, size, &stack, type);\ if (!nothrow && UNLIKELY(!res)) ReportOutOfMemory(size, &stack);\ return res; - +#endif // On OS X it's not enough to just provide our own 'operator new' and // 'operator delete' implementations, because they're going to be in the // runtime dylib, and the main executable will depend on both the runtime