diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-03 01:29:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-03 01:29:41 +0000 |
commit | af7893203bc2fb3df2c25289d5a79d6bbf82844d (patch) | |
tree | df5d47357faf0d30f55e5062e4bf62bb296b12bd /llvm/lib/Transforms/Scalar | |
parent | 7af7d94df2d88dcc9b1b65518fdb108b292defec (diff) | |
download | bcm5719-llvm-af7893203bc2fb3df2c25289d5a79d6bbf82844d.tar.gz bcm5719-llvm-af7893203bc2fb3df2c25289d5a79d6bbf82844d.zip |
Fix bug with zero sized casts
llvm-svn: 9667
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index bbdfda3f76b..534ba5946e2 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1552,7 +1552,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) { unsigned CastElTySize = TD->getTypeSize(CastElTy); // If the allocation is for an even multiple of the cast type size - if (AllocElTySize % CastElTySize == 0) { + if (CastElTySize && (AllocElTySize % CastElTySize == 0)) { Value *Amt = ConstantUInt::get(Type::UIntTy, AllocElTySize/CastElTySize); std::string Name = AI->getName(); AI->setName(""); |