[asan] Use 1 byte aligned stores to poison shadow memory
authorVitaly Buka <vitalybuka@google.com>
Mon, 22 Aug 2016 04:16:14 +0000 (04:16 +0000)
committerVitaly Buka <vitalybuka@google.com>
Mon, 22 Aug 2016 04:16:14 +0000 (04:16 +0000)
Summary: r279379 introduced crash on arm 32bit bot. I suspect this is alignment issue.

Reviewers: eugenis

Subscribers: llvm-commits, aemerson

Differential Revision: https://reviews.llvm.org/D23762

llvm-svn: 279413

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 7bf958e..53dd96e 100644 (file)
@@ -2011,8 +2011,8 @@ void FunctionStackPoisoner::poisonStackFrameInline(
 
     Value *Ptr = IRB.CreateAdd(ShadowBase, ConstantInt::get(IntptrTy, i));
     Value *Poison = IRB.getIntN(StoreSizeInBytes * 8, Val);
-    IRB.CreateStore(Poison,
-                    IRB.CreateIntToPtr(Ptr, Poison->getType()->getPointerTo()));
+    IRB.CreateAlignedStore(
+        Poison, IRB.CreateIntToPtr(Ptr, Poison->getType()->getPointerTo()), 1);
 
     i += StoreSizeInBytes;
   }