diff options
| author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-12-04 02:30:42 +0000 |
|---|---|---|
| committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-12-04 02:30:42 +0000 |
| commit | be526cfba461cf99e5a20c255127f3d22bfd9793 (patch) | |
| tree | fbb13efc64b340826be8efa23c24ec199e574b99 /llvm/lib | |
| parent | b92de191168694bf2531b1ae5df74abad7b7f2fe (diff) | |
| download | bcm5719-llvm-be526cfba461cf99e5a20c255127f3d22bfd9793.tar.gz bcm5719-llvm-be526cfba461cf99e5a20c255127f3d22bfd9793.zip | |
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.
llvm-svn: 18484
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 3a3e6e5c325..4653ef89551 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -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) { |

