diff options
Diffstat (limited to 'test/msan/strlen_of_shadow.cc')
-rw-r--r-- | test/msan/strlen_of_shadow.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/msan/strlen_of_shadow.cc b/test/msan/strlen_of_shadow.cc index 763b3a1c73c09..3066dd5b61ae9 100644 --- a/test/msan/strlen_of_shadow.cc +++ b/test/msan/strlen_of_shadow.cc @@ -7,16 +7,20 @@ #include <stdint.h> #include <stdio.h> #include <string.h> +#include <stdlib.h> +#include "test.h" const char *mem_to_shadow(const char *p) { #if defined(__x86_64__) - return (char *)((uintptr_t)p & ~0x400000000000ULL); + return (char *)((uintptr_t)p ^ 0x500000000000ULL); #elif defined (__mips64) return (char *)((uintptr_t)p & ~0x4000000000ULL); #elif defined(__powerpc64__) #define LINEARIZE_MEM(mem) \ (((uintptr_t)(mem) & ~0x200000000000ULL) ^ 0x100000000000ULL) return (char *)(LINEARIZE_MEM(p) + 0x080000000000ULL); +#elif defined(__aarch64__) + return (char *)((uintptr_t)p ^ 0x6000000000ULL); #endif } |