[PATCH] D49473: [MSan] pull insertShadowCheck() into getShadowOriginPtr(). NFC

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 04:02:28 PDT 2018


glider created this revision.
glider added reviewers: eugenis, kcc.
glider added a project: Sanitizers.
Herald added a subscriber: llvm-commits.

There's a bunch of calls to insertShadowCheck(Addr, ...) scattered around MemorySanitizer.cpp
Most of them follow a call to getShadowOriginPtr(Addr, ...) and check that the shadow value of the Addr pointer is non-null before dereferencing it.

Currently the code created by getShadowOriginPtr() for userspace programs is quite simple, so it shouldn't matter much whether the check is performed before calculating the shadow address or after doing that (maybe the compiler is even able to move it after the check).
But for KMSAN getShadowOriginPtr() creates a runtime call, so we want the check to be performed before the call.


Repository:
  rL LLVM

https://reviews.llvm.org/D49473

Files:
  lib/Transforms/Instrumentation/MemorySanitizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49473.156040.patch
Type: text/x-patch
Size: 20456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180718/e7426d73/attachment.bin>


More information about the llvm-commits mailing list