mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
make sure that BranchInst::getSuccessor() does not assert in cast<>
even if the underlying operand is NULL. This may happen in debugging context within opt with partial loop unrolling (see test/Transforms/LoopUnroll/partial.ll). After this fix I can resubmit the (backed out) r63459: * lib/VMCore/AsmWriter.cpp: use precise accessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user