mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Check if a block has a terminator first before calling front() on
it. If a block has a terminator then it is certainly non-empty so the verifier will not crash on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18484 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -321,6 +321,9 @@ void Verifier::visitFunction(Function &F) {
|
||||
void Verifier::visitBasicBlock(BasicBlock &BB) {
|
||||
InstsInThisBlock.clear();
|
||||
|
||||
// Ensure that basic blocks have terminators!
|
||||
Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
|
||||
|
||||
// Check constraints that this basic block imposes on all of the PHI nodes in
|
||||
// it.
|
||||
if (isa<PHINode>(BB.front())) {
|
||||
@@ -364,9 +367,6 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that basic blocks have terminators!
|
||||
Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
|
||||
}
|
||||
|
||||
void Verifier::visitTerminatorInst(TerminatorInst &I) {
|
||||
|
||||
Reference in New Issue
Block a user