aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 1a9b9d7..7db409d 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3844,7 +3844,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI,
} else if (isa<Instruction>(NumElements) &&
cast<Instruction>(NumElements)->getOpcode() == Instruction::Mul){
BinaryOperator *BO = cast<BinaryOperator>(NumElements);
- if (ConstantUInt *Scale = cast<ConstantUInt>(BO->getOperand(1))) {
+ if (ConstantUInt *Scale = dyn_cast<ConstantUInt>(BO->getOperand(1))) {
// This value is scaled by 'Scale'.
NumElements = BO->getOperand(0);
ArraySizeScale = Scale->getValue();