[esan] Fix isShadowMem endpoint bug

Fixes a bug in checking the endpoint of a shadow region and removes an
invalid check (both introduced in http://reviews.llvm.org/rL269198).

llvm-svn: 269834
This commit is contained in:
Derek Bruening 2016-05-17 20:44:09 +00:00
parent 759af30109
commit 1f6d861ac2
1 changed files with 1 additions and 2 deletions

View File

@ -149,7 +149,6 @@ bool isAppMem(uptr Mem) {
ALWAYS_INLINE
uptr appToShadow(uptr App) {
DCHECK(isAppMem(App));
return (((App & ShadowMapping::Mask) + Mapping.Offset) >> Mapping.Scale);
}
@ -186,7 +185,7 @@ bool isShadowMem(uptr Mem) {
// no need to hardcode the mapping results.
for (uptr i = 0; i < NumAppRegions; ++i) {
if (Mem >= appToShadow(AppRegions[i].Start) &&
Mem < appToShadow(AppRegions[i].End))
Mem < appToShadow(AppRegions[i].End - 1) + 1)
return true;
}
return false;