[asan] fix one more bug related to long double
authorKostya Serebryany <kcc@google.com>
Wed, 21 Mar 2012 15:28:50 +0000 (15:28 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 21 Mar 2012 15:28:50 +0000 (15:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153189 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index a51bd7e41c85ff629a7886c98a6bad1025b662ec..b43b9e5faceef29afaa9e8dc446cf80b8284dc9e 100644 (file)
@@ -454,7 +454,7 @@ bool AddressSanitizer::insertGlobalRedzones(Module &M) {
     GlobalVariable *G = GlobalsToChange[i];
     PointerType *PtrTy = cast<PointerType>(G->getType());
     Type *Ty = PtrTy->getElementType();
-    uint64_t SizeInBytes = TD->getTypeStoreSizeInBits(Ty) / 8;
+    uint64_t SizeInBytes = TD->getTypeAllocSize(Ty);
     uint64_t RightRedzoneSize = RedzoneSize +
         (RedzoneSize - (SizeInBytes % RedzoneSize));
     Type *RightRedZoneTy = ArrayType::get(IRB.getInt8Ty(), RightRedzoneSize);