summaryrefslogtreecommitdiffstats
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index fbf376a..d8ce835 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -2186,7 +2186,9 @@ public:
BasicBlock *getSuccessor(unsigned i) const {
assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
- return cast<BasicBlock>(getOperand(i));
+ if (Value *V = getOperand(i))
+ return cast<BasicBlock>(V);
+ return 0;
}
void setSuccessor(unsigned idx, BasicBlock *NewSucc) {