ASan: use getTypeAllocSize instead of getTypeStoreSize.
[oota-llvm.git] / lib / Transforms / Instrumentation / AddressSanitizer.cpp
index ce5d43a68fce9a52cd12977a1c70f80bca46a6fc..123e39904231a4ebe00b96a4bd00dca0384c7d4b 100644 (file)
@@ -167,7 +167,7 @@ struct AddressSanitizer : public ModulePass {
 
   uint64_t getAllocaSizeInBytes(AllocaInst *AI) {
     Type *Ty = AI->getAllocatedType();
-    uint64_t SizeInBytes = TD->getTypeStoreSizeInBits(Ty) / 8;
+    uint64_t SizeInBytes = TD->getTypeAllocSize(Ty);
     return SizeInBytes;
   }
   uint64_t getAlignedSize(uint64_t SizeInBytes) {