[PATCH] D27428: [sanitizer] Do not use the alignment-rounded-up size when using the secondary

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 09:31:37 PST 2016


alekseyshl added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_allocator_combined.h:62
     if (alignment > 8)
       CHECK_EQ(reinterpret_cast<uptr>(res) & (alignment - 1), 0);
     if (cleared && res && from_primary)
----------------
Is it safe to run this CHECK now, when secondary is using non-adjusted allocation size? 


================
Comment at: lib/sanitizer_common/sanitizer_allocator_combined.h:64
     if (cleared && res && from_primary)
       internal_bzero_aligned16(res, RoundUpTo(size, 16));
     return res;
----------------
Same here, it tries to zero out the result up to the rounded up size, not the original size.


https://reviews.llvm.org/D27428





More information about the llvm-commits mailing list