summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mapping.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2011-11-30 18:50:23 +0000
committerKostya Serebryany <kcc@google.com>2011-11-30 18:50:23 +0000
commit218a9b70d7338cf5b727b7dad6b080ad7869c6c2 (patch)
treea77cbe7294d01247e1104cbb20bd027865dad473 /lib/asan/asan_mapping.h
parentcbab911ea555f34c8ac66b4c7dc88f4e7ecf2c03 (diff)
Refactor shadow poisoning done by asan-rt, no funtionality changes; patch by samsonov@google.com
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mapping.h')
-rw-r--r--lib/asan/asan_mapping.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/asan/asan_mapping.h b/lib/asan/asan_mapping.h
index 064cea92e..63aba10a2 100644
--- a/lib/asan/asan_mapping.h
+++ b/lib/asan/asan_mapping.h
@@ -91,6 +91,10 @@ static inline bool AddrIsInShadow(uintptr_t a) {
return AddrIsInLowShadow(a) || AddrIsInHighShadow(a);
}
+static inline bool AddrIsAlignedByGranularity(uintptr_t a) {
+ return (a & (SHADOW_GRANULARITY - 1)) == 0;
+}
+
} // namespace __asan
#endif // ASAN_MAPPING_H