[llvm] r175266 - [asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer/issues/detail?id=151

Kostya Serebryany kcc at google.com
Fri Feb 15 04:46:07 PST 2013


Author: kcc
Date: Fri Feb 15 06:46:06 2013
New Revision: 175266

URL: http://llvm.org/viewvc/llvm-project?rev=175266&view=rev
Log:
[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer/issues/detail?id=151

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=175266&r1=175265&r2=175266&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Fri Feb 15 06:46:06 2013
@@ -639,7 +639,7 @@ void AddressSanitizer::instrumentMop(Ins
   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) {

Modified: llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll?rev=175266&r1=175265&r2=175266&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll (original)
+++ llvm/trunk/test/Instrumentation/AddressSanitizer/basic.ll Fri Feb 15 06:46:06 2013
@@ -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





More information about the llvm-commits mailing list