We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bdf387 commit 77c90ebCopy full SHA for 77c90eb
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -668,16 +668,7 @@ struct AddressSanitizer {
668
}
669
670
TypeSize getAllocaSizeInBytes(const AllocaInst &AI) const {
671
- uint64_t ArraySize = 1;
672
- if (AI.isArrayAllocation()) {
673
- const ConstantInt *CI = dyn_cast<ConstantInt>(AI.getArraySize());
674
- assert(CI && "non-constant array size");
675
- ArraySize = CI->getZExtValue();
676
- }
677
- Type *Ty = AI.getAllocatedType();
678
- TypeSize SizeInBytes =
679
- AI.getModule()->getDataLayout().getTypeAllocSize(Ty);
680
- return SizeInBytes * ArraySize;
+ return *AI.getAllocationSize(AI.getModule()->getDataLayout());
681
682
683
/// Check if we want (and can) handle this alloca.
0 commit comments