[asan] Restore dead-code-elimination optimization for Fuchsia
Summary: r310244 fixed a bug introduced by r309914 for non-Fuchsia builds. In doing so it also reversed the intended effect of the change for Fuchsia builds, which was to allow all the AllocateFromLocalPool code and its variables to be optimized away entirely. This change restores that optimization for Fuchsia builds, but doesn't have the original change's bug because the comparison arithmetic now takes into account the size of the elements. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36430 llvm-svn: 310330
This commit is contained in:
parent
1285013dbe
commit
4bc6c466b8
|
@ -32,7 +32,7 @@ static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize];
|
|||
|
||||
static INLINE bool IsInDlsymAllocPool(const void *ptr) {
|
||||
uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym;
|
||||
return off < sizeof(alloc_memory_for_dlsym);
|
||||
return off < allocated_for_dlsym * sizeof(alloc_memory_for_dlsym[0]);
|
||||
}
|
||||
|
||||
static void *AllocateFromLocalPool(uptr size_in_bytes) {
|
||||
|
|
Loading…
Reference in New Issue