[compiler-rt] [TSan] Clarify and enforce shadow end alignment (PR #144648)

Kunqiu Chen via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 21 07:20:49 PDT 2025


Camsyn 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). (If no: are there are some minor code cleanups that would make the assertion approach work?)

I also really think it's not good to add a new utility function in `tsan_platform.h` for this scenario.
Adhering to your suggestion, I have removed the new utility function `MemToEndShadow` and rewritten the PR description.



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


More information about the llvm-commits mailing list