summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>2018-08-15 21:41:23 +0200
committerMasatoshi Kimura <VYV03354@nifty.ne.jp>2018-08-15 21:41:23 +0200
commit11a1106c261a49777b54d8fa47739bc96082f598 (patch)
treef3f724495f0a1b87687d22984bfd0567a0219ca4 /lib
parentc72676fdfe73a66398ea4b213069cb9154161f69 (diff)
downloadnspr-hg-11a1106c261a49777b54d8fa47739bc96082f598.tar.gz
Bug 1306642, ASAN poisoning functions shouldn't be dllimport on Windows, r=kaie
Diffstat (limited to 'lib')
-rw-r--r--lib/ds/plarena.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/ds/plarena.h b/lib/ds/plarena.h
index 5336a0e4..0ca00c0a 100644
--- a/lib/ds/plarena.h
+++ b/lib/ds/plarena.h
@@ -95,13 +95,24 @@ struct PLArenaPool {
#if defined(PL_SANITIZE_ADDRESS)
+#if defined(_MSC_VER)
+/* We can't use dllimport due to DLL linkage mismatch with
+ * sanitizer/asan_interface.h.
+ */
+#define PL_ASAN_VISIBILITY(type_) type_
+#else
+#define PL_ASAN_VISIBILITY(type_) PR_IMPORT(type_)
+#endif
+
/* These definitions are usually provided through the
* sanitizer/asan_interface.h header installed by ASan.
* See https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
*/
-PR_IMPORT(void) __asan_poison_memory_region(void const volatile *addr, size_t size);
-PR_IMPORT(void) __asan_unpoison_memory_region(void const volatile *addr, size_t size);
+PL_ASAN_VISIBILITY(void) __asan_poison_memory_region(
+ void const volatile *addr, size_t size);
+PL_ASAN_VISIBILITY(void) __asan_unpoison_memory_region(
+ void const volatile *addr, size_t size);
#define PL_MAKE_MEM_NOACCESS(addr, size) \
__asan_poison_memory_region((addr), (size))