summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mapping.h
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2012-07-23 08:22:27 +0000
committerAlexander Potapenko <glider@google.com>2012-07-23 08:22:27 +0000
commit79d12e87fbcc1b2342d76367b99b83adf9cbf499 (patch)
tree5794cc4c4aa06e73f4a4004593bcc6d86729e425 /lib/asan/asan_mapping.h
parent08e80a43a4046f50270cc86b5ad3a16b94375f97 (diff)
For wild addresses in the shadow or shadow gap areas print an error message instead of crashing on a check.
Add AddressSanitizer.MemsetWildAddressTest that makes sure a proper error message is printed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160620 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 6bf79a39c..8e0c6ec5d 100644
--- a/lib/asan/asan_mapping.h
+++ b/lib/asan/asan_mapping.h
@@ -97,6 +97,10 @@ static inline bool AddrIsInShadow(uptr a) {
return AddrIsInLowShadow(a) || AddrIsInHighShadow(a);
}
+static inline bool AddrIsInShadowGap(uptr a) {
+ return a >= kShadowGapBeg && a <= kShadowGapEnd;
+}
+
static inline bool AddrIsAlignedByGranularity(uptr a) {
return (a & (SHADOW_GRANULARITY - 1)) == 0;
}