From 7342c5ed8c95cc25241b45e91a98b4048c12fe6a Mon Sep 17 00:00:00 2001
From: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Date: Tue, 12 May 2015 20:16:51 -0700
Subject: tests: Disable page allocator if address sanitizer is active

Address sanitizer can detect underflows so we don't really need the custom
allocator.

Additionally, custom allocator can return memory that is not pointer-aligned;
this causes undefined behavior sanitizer to complain.
---
 tests/allocator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/allocator.cpp b/tests/allocator.cpp
index e1d99d5..a2bcb48 100644
--- a/tests/allocator.cpp
+++ b/tests/allocator.cpp
@@ -67,7 +67,7 @@ namespace
 		VirtualProtect(rptr, aligned_size + page_size, PAGE_NOACCESS, &old_flags);
 	}
 }
-#elif defined(__APPLE__) || defined(__linux__)
+#elif (defined(__APPLE__) || defined(__linux__)) && !((defined(__has_feature) && __has_feature(address_sanitizer)) || defined(__SANITIZE_ADDRESS__))
 #	include <sys/mman.h>
 
 namespace
-- 
cgit v1.2.3