[PATCH] D115167: [DSE] Use precise loc for memset_chk writing to local objects.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 7 12:54:08 PST 2021


efriedma added a comment.

In D115167#3176652 <https://reviews.llvm.org/D115167#3176652>, @fhahn wrote:

> It might have been overly conservative on my side. I was thinking about cases where a failing `memset_chk` aborts the current thread/process but not other threads or  processes that may access the same (shared) memory. But if that's not an issue the restriction can be removed.

memset_chk aborts the whole process.  Throwing an exception on an out-of-bounds access is a popular model in other contexts, but memset_chk is not defined that way.  It's meant purely as a hardening measure.

memset_chk should not be used on memory shared with other processes.  Accesses to such memory should be volatile or atomic; otherwise, weird stuff can happen for a variety of reasons...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115167/new/

https://reviews.llvm.org/D115167



More information about the llvm-commits mailing list