[PATCH] D134698: Hook D134410 into msan
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 26 21:28:57 PDT 2022
vitalybuka created this revision.
Herald added subscribers: Enna1, hiraditya.
Herald added a project: All.
vitalybuka requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134698
Files:
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -2137,8 +2137,14 @@
if (PropagateShadow) {
std::tie(ShadowPtr, OriginPtr) =
getShadowOriginPtr(Addr, IRB, ShadowTy, Alignment, /*isStore*/ false);
- setShadow(&I,
- IRB.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"));
+ if (I.getMetadata(LLVMContext::MD_noundef)) {
+ insertShadowCheck(
+ IRB.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"), &I);
+ setShadow(&I, getCleanShadow(&I));
+ } else {
+ setShadow(
+ &I, IRB.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"));
+ }
} else {
setShadow(&I, getCleanShadow(&I));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134698.463087.patch
Type: text/x-patch
Size: 924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220927/d42356de/attachment.bin>
More information about the llvm-commits
mailing list