[compiler-rt] [TSan] Fix potentially problematic shadow end calculations (PR #144648)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 09:23:31 PDT 2025


thurstond wrote:

Thanks for the patch!

> If it is not appropriate to add a new utility function in `tsan_platform.h`, we can follow the example of `MemoryRangeSet` or `MemoryResetRange`, and
> 
> * add an assertion to guarantee `addr_end % kShadowCell == 0`; or

If the assertion is added, do all the tests pass, and does it fix all the problems that adding `MemToEndShadow` would? If yes, then that is the more elegant solution (besides, I'd probably personally forget to use `MemToEndShadow` instead of `MemToShadow` when updating the code).


https://github.com/llvm/llvm-project/pull/144648


More information about the llvm-commits mailing list