diff options
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index ed0f89bfb59..8cc0084db59 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -503,15 +503,16 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {    /// address.    ///    /// OriginAddr = (ShadowAddr + OriginOffset) & ~3ULL -  ///            = Addr & (~ShadowMask & ~3ULL) + OriginOffset    Value *getOriginPtr(Value *Addr, IRBuilder<> &IRB) {      Value *ShadowLong =        IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy), -                    ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask & ~3ULL)); +                    ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask));      Value *Add =        IRB.CreateAdd(ShadowLong,                      ConstantInt::get(MS.IntptrTy, MS.OriginOffset)); -    return IRB.CreateIntToPtr(Add, PointerType::get(IRB.getInt32Ty(), 0)); +    Value *SecondAnd = +      IRB.CreateAnd(Add, ConstantInt::get(MS.IntptrTy, ~3ULL)); +    return IRB.CreateIntToPtr(SecondAnd, PointerType::get(IRB.getInt32Ty(), 0));    }    /// \brief Compute the shadow address for a given function argument. | 

