[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer...
authorKostya Serebryany <kcc@google.com>
Fri, 15 Feb 2013 12:46:06 +0000 (12:46 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 15 Feb 2013 12:46:06 +0000 (12:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175266 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/basic.ll

index b97e3425bccaae4d7dc3582851630939eaf1f463..5769e942a59f7c69b33ba982783d9e7fdaf5c3c6 100644 (file)
@@ -639,7 +639,7 @@ void AddressSanitizer::instrumentMop(Instruction *I) {
   Type *OrigTy = cast<PointerType>(OrigPtrTy)->getElementType();
 
   assert(OrigTy->isSized());
-  uint32_t TypeSize = TD->getTypeStoreSizeInBits(OrigTy);
+  uint32_t TypeSize = TD->getTypeAllocSizeInBits(OrigTy);
 
   if (TypeSize != 8  && TypeSize != 16 &&
       TypeSize != 32 && TypeSize != 64 && TypeSize != 128) {
index bcea2ce645f9d47b98f11612865239f72ad1c580..746caf704bd4860a6239032acefa6fb3ac1d2606 100644 (file)
@@ -89,3 +89,12 @@ entry:
 ; CHECK-NOT: = alloca
 ; CHECK: ret void
 
+define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable address_safety {
+entry:
+    store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %a, align 16
+    ret void
+}
+
+; CHECK: LongDoubleTest
+; CHECK: __asan_report_store16
+; CHECK: ret void