diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerAllocations.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerAllocations.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp index 6c599260171..9a7f36692fd 100644 --- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp +++ b/llvm/lib/Transforms/Utils/LowerAllocations.cpp @@ -115,7 +115,8 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { // malloc(type) becomes sbyte *malloc(size) Value *MallocArg; if (LowerMallocArgToInteger) - MallocArg = ConstantInt::get(Type::Int64Ty, TD.getABITypeSize(AllocTy)); + MallocArg = ConstantInt::get(Type::Int64Ty, + TD.getTypePaddedSize(AllocTy)); else MallocArg = ConstantExpr::getSizeOf(AllocTy); MallocArg = ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg), |

