aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-03 01:29:41 +0000
committerChris Lattner <sabre@nondot.org>2003-11-03 01:29:41 +0000
commit8ee9204309edafc981db6cf71f282e071034b1a4 (patch)
tree6b7221fab25d3e9e9f2bc8742297b85b1d933b8d /lib/Transforms/Scalar
parent7635ea4230b6e1c830f54604bc5593fcabb24311 (diff)
downloadexternal_llvm-8ee9204309edafc981db6cf71f282e071034b1a4.zip
external_llvm-8ee9204309edafc981db6cf71f282e071034b1a4.tar.gz
external_llvm-8ee9204309edafc981db6cf71f282e071034b1a4.tar.bz2
Fix bug with zero sized casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index bbdfda3..534ba59 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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("");