aboutsummaryrefslogtreecommitdiff
path: root/lib/dfsan/dfsan.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dfsan/dfsan.h')
-rw-r--r--lib/dfsan/dfsan.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/dfsan/dfsan.h b/lib/dfsan/dfsan.h
index ceba3533a233..81f949e3019e 100644
--- a/lib/dfsan/dfsan.h
+++ b/lib/dfsan/dfsan.h
@@ -16,6 +16,7 @@
#define DFSAN_H
#include "sanitizer_common/sanitizer_internal_defs.h"
+#include "dfsan_platform.h"
// Copy declarations from public sanitizer/dfsan_interface.h header here.
typedef u16 dfsan_label;
@@ -44,11 +45,7 @@ namespace __dfsan {
void InitializeInterceptors();
inline dfsan_label *shadow_for(void *ptr) {
-#if defined(__x86_64__)
- return (dfsan_label *) ((((uptr) ptr) & ~0x700000000000) << 1);
-#elif defined(__mips64)
- return (dfsan_label *) ((((uptr) ptr) & ~0xF000000000) << 1);
-#endif
+ return (dfsan_label *) ((((uptr) ptr) & ShadowMask()) << 1);
}
inline const dfsan_label *shadow_for(const void *ptr) {