diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-02-06 21:47:39 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2015-02-06 21:47:39 +0000 |
| commit | 4e12057760c2bd1b1ae96bf15c2b9d4464475ac8 (patch) | |
| tree | 7bd9c253d264fe38f882feeb2a5ba59eb6d6e58e /llvm/lib/Transforms/Instrumentation | |
| parent | be9c91173f7b9e2d05418ccd6bcfc92df35db84e (diff) | |
| download | bcm5719-llvm-4e12057760c2bd1b1ae96bf15c2b9d4464475ac8.tar.gz bcm5719-llvm-4e12057760c2bd1b1ae96bf15c2b9d4464475ac8.zip | |
[msan] Fix "missing origin" in atomic store.
An atomic store always make the target location fully initialized (in the
current implementation). It should not store origin. Initialized memory can't
have meaningful origin, and, due to origin granularity (4 bytes) there is a
chance that this extra store would overwrite meaningfull origin for an adjacent
location.
llvm-svn: 228444
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 4109bfdc304..b475234a4a2 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -702,7 +702,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { if (SI.isAtomic()) SI.setOrdering(addReleaseOrdering(SI.getOrdering())); - if (MS.TrackOrigins) + if (MS.TrackOrigins && !SI.isAtomic()) storeOrigin(IRB, Addr, Shadow, getOrigin(Val), SI.getAlignment(), InstrumentWithCalls); } |

