summaryrefslogtreecommitdiff
path: root/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-20 21:48:08 +0000
committerChris Lattner <sabre@nondot.org>2007-04-20 21:48:08 +0000
commit19b6dcdfa9832fbdcf69ec6db4c12d256bd709e7 (patch)
tree891dd570f90c0d12c4dbee3eea6321f3235ffdbd /lib/VMCore/Verifier.cpp
parentb3a0417cad8b625acc3033bd5e24afb9ffd0b084 (diff)
downloadllvm-19b6dcdfa9832fbdcf69ec6db4c12d256bd709e7.tar.gz
llvm-19b6dcdfa9832fbdcf69ec6db4c12d256bd709e7.tar.bz2
llvm-19b6dcdfa9832fbdcf69ec6db4c12d256bd709e7.tar.xz
catch a case that was biting jeffc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r--lib/VMCore/Verifier.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 98f26495ce..c0a0dc6e69 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -867,12 +867,17 @@ void Verifier::visitInstruction(Instruction &I) {
// taken.
Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
"Cannot take the address of an intrinsic!", &I);
+ Assert1(F->getParent() == Mod, "Referencing function in another module!",
+ &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 (GlobalValue *GV = dyn_cast<GlobalValue>(I.getOperand(i))) {
+ Assert1(GV->getParent() == Mod, "Referencing global in another module!",
+ &I);
} else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
BasicBlock *OpBlock = Op->getParent();
@@ -952,7 +957,8 @@ void Verifier::visitInstruction(Instruction &I) {
///
void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
Function *IF = CI.getCalledFunction();
- Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", IF);
+ Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!",
+ IF);
#define GET_INTRINSIC_VERIFIER
#include "llvm/Intrinsics.gen"