Skip to content
Snippets Groups Projects
Commit a562bf6d authored by Arseny Kapoulkine's avatar Arseny Kapoulkine
Browse files

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.
parent 4460da54
No related branches found
No related tags found
No related merge requests found
......@@ -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 <sys/mman.h>
namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment