From a562bf6d3c9ee3cb4fdf52e34dd1539f819ffa8b Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 25 Jul 2015 14:05:06 -0400 Subject: tests: Only enable page heap on x86/x64 This fixes tests in PUGIXML_NO_XPATH mode on SPARC64 (#48). SPARC does not allow unaligned accesses - e.g. you can't read an unaligned int. Normally pugixml does not perform unaligned integer/pointer accesses, but page heap can allocate blocks that are not aligned so that we can detect a single- byte read/write overrun. Additionally, the hardcoded page size we're currently using is really system specific - on SPARC the page size can be 8 Kb instead of 4 Kb so mprotect can fail. --- tests/allocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/allocator.cpp') diff --git a/tests/allocator.cpp b/tests/allocator.cpp index e5c634c..3db390e 100644 --- a/tests/allocator.cpp +++ b/tests/allocator.cpp @@ -74,7 +74,7 @@ namespace VirtualProtect(rptr, aligned_size + page_size, PAGE_NOACCESS, &old_flags); } } -#elif (defined(__APPLE__) || defined(__linux__)) && !ADDRESS_SANITIZER +#elif (defined(__APPLE__) || defined(__linux__)) && (defined(__i386) || defined(__x86_64)) && !ADDRESS_SANITIZER # include namespace -- cgit v1.2.3