Skip to content

Commit fcc6038

Browse files
committed
[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). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269834 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7677ebe commit fcc6038

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/esan/esan_shadow.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ bool isAppMem(uptr Mem) {
149149

150150
ALWAYS_INLINE
151151
uptr appToShadow(uptr App) {
152-
DCHECK(isAppMem(App));
153152
return (((App & ShadowMapping::Mask) + Mapping.Offset) >> Mapping.Scale);
154153
}
155154

@@ -186,7 +185,7 @@ bool isShadowMem(uptr Mem) {
186185
// no need to hardcode the mapping results.
187186
for (uptr i = 0; i < NumAppRegions; ++i) {
188187
if (Mem >= appToShadow(AppRegions[i].Start) &&
189-
Mem < appToShadow(AppRegions[i].End))
188+
Mem < appToShadow(AppRegions[i].End - 1) + 1)
190189
return true;
191190
}
192191
return false;

0 commit comments

Comments
 (0)