[asan] Dedup MemToShadowSize

Added D83247 and D84004.
This commit is contained in:
Vitaly Buka 2020-07-17 02:38:18 -07:00
parent e297006d6f
commit e412cc402e
2 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,6 @@ extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; // Initialized in __asan_init.
namespace __asan {
static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
static inline bool AddrIsInLowMem(uptr a) {
PROFILE_ASAN_MAPPING();
return a <= kLowMemEnd;
@ -356,6 +355,8 @@ static inline bool AddrIsInShadowGap(uptr a) {
namespace __asan {
static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
static inline bool AddrIsInMem(uptr a) {
PROFILE_ASAN_MAPPING();
return AddrIsInLowMem(a) || AddrIsInMidMem(a) || AddrIsInHighMem(a) ||

View File

@ -61,7 +61,6 @@
namespace __asan {
static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
static inline bool AddrIsInLowMem(uptr a) {
PROFILE_ASAN_MAPPING();
return a <= kLowMemEnd;