Commit db4f1ee4 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[lsan] Disable annotations on windows

LSan is not implemented on windows, and trying to use the
{__lsan_ignore_object} function gives link error.
Since LSan is never enabled on windows, we also don't need the
annotations, so just disable them on windows.

R=bmeurer@chromium.org

Bug: chromium:842166,v8:7738
Change-Id: Ibaed77b4b884c09c7a08e081d953c56c53f907ff
Reviewed-on: https://chromium-review.googlesource.com/1056990Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53141}
parent 0a713473
......@@ -12,19 +12,20 @@
// There is no compile time flag for LSan, to enable this whenever ASan is
// enabled. Note that LSan can be used as part of ASan with 'detect_leaks=1'.
#ifdef V8_USE_ADDRESS_SANITIZER
// On windows, LSan is not implemented yet, so disable it there.
#if defined(V8_USE_ADDRESS_SANITIZER) && !defined(V8_OS_WIN)
#include <sanitizer/lsan_interface.h>
#define LSAN_IGNORE_OBJECT(ptr) __lsan_ignore_object(ptr)
#else // !V8_USE_ADDRESS_SANITIZER
#else // defined(V8_USE_ADDRESS_SANITIZER) && !defined(V8_OS_WIN)
#define LSAN_IGNORE_OBJECT(ptr) \
static_assert(std::is_pointer<decltype(ptr)>::value || \
std::is_same<v8::internal::Address, decltype(ptr)>::value, \
"static type violation")
#endif // V8_USE_ADDRESS_SANITIZER
#endif // defined(V8_USE_ADDRESS_SANITIZER) && !defined(V8_OS_WIN)
#endif // V8_LSAN_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment