aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 7421d4f349..e931c37989 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -451,7 +451,8 @@ void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
}
// Constant condition variables mean the branch can only go a single way.
- Succs[cast<ConstantInt>(BCValue.getConstant())->isZero()] = true;
+ if (BCValue.isConstant())
+ Succs[cast<ConstantInt>(BCValue.getConstant())->isZero()] = true;
return;
}