diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:23:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:23:54 +0000 |
commit | 59c3569b14433a3f2197e2c3933c21568c68102c (patch) | |
tree | c80cd75fe362c8d4d0cd769daf3d331fab9f2eaf | |
parent | ffada9327301094411146627cf6bc16cd517585d (diff) |
Catch some more cases of broken code. The loop extractor seems to be creating
situations where there is a branch that goes to a block in another function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12379 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Verifier.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 768bf4dc81..73285cddde 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -508,11 +508,16 @@ void Verifier::visitInstruction(Instruction &I) { for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { // Check to make sure that the "address of" an intrinsic function is never // taken. - if (Function *F = dyn_cast<Function>(I.getOperand(i))) + if (Function *F = dyn_cast<Function>(I.getOperand(i))) { Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)), "Cannot take the address of an intrinsic!", &I); - - else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) { + } else if (BasicBlock *OpBB = dyn_cast<BasicBlock>(I.getOperand(i))) { + Assert1(OpBB->getParent() == BB->getParent(), + "Referring to a basic block in another function!", &I); + } else if (Argument *OpArg = dyn_cast<Argument>(I.getOperand(i))) { + Assert1(OpArg->getParent() == BB->getParent(), + "Referring to an argument in another function!", &I); + } else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) { BasicBlock *OpBlock = Op->getParent(); // Check that a definition dominates all of its uses. |