diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-10-17 23:29:44 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-10-17 23:29:44 +0000 |
commit | e08633e90086dd2d74c7fe268ef10c05209aeda2 (patch) | |
tree | 0653a8815542b2d272e49258f390b100390cdd3b /llvm/lib/Transforms | |
parent | 766cf6096160b68ba518f8ec44f8f91bb82fcdd4 (diff) | |
download | bcm5719-llvm-e08633e90086dd2d74c7fe268ef10c05209aeda2.tar.gz bcm5719-llvm-e08633e90086dd2d74c7fe268ef10c05209aeda2.zip |
[msan] Fix handling of byval arguments with large alignment.
MSan param-tls slots are 8-byte aligned. This change clips
alignment of memcpy into param-tls to 8.
llvm-svn: 220101
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 3a311edf5e3..5a261c62f22 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2329,7 +2329,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { assert(A->getType()->isPointerTy() && "ByVal argument is not a pointer!"); Size = MS.DL->getTypeAllocSize(A->getType()->getPointerElementType()); - unsigned Alignment = CS.getParamAlignment(i + 1); + unsigned ParamAlignment = CS.getParamAlignment(i + 1); + unsigned Alignment = std::min(ParamAlignment, kShadowTLSAlignment); Store = IRB.CreateMemCpy(ArgShadowBase, getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB), Size, Alignment); |