[PATCH] D60617: MSan: handle llvm.lifetime.start intrinsic

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 07:24:41 PDT 2019


glider created this revision.
glider added reviewers: eugenis, pcc.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

When a variable goes into scope several times within a single function
or when two variables from different scopes share a stack slot it may
be incorrect to poison such scoped locals at the beginning of the
function.
In the former case it may lead to false negatives (see
https://github.com/google/sanitizers/issues/590), in the latter - to
incorrect reports (because only one origin remains on the stack).

If Clang emits lifetime intrinsics with known size for such scoped
variables we insert code poisoning them after each call to
llvm.lifetime.start(). This is done on a best-effort basis.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60617

Files:
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/test/Instrumentation/MemorySanitizer/alloca.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60617.194880.patch
Type: text/x-patch
Size: 6009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190412/8a59605e/attachment.bin>


More information about the llvm-commits mailing list