aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-11 20:29:49 +0000
committerChris Lattner <sabre@nondot.org>2006-07-11 20:29:49 +0000
commitf4ea921cc70ce3c8c75cce90af4b672c7f81c7b2 (patch)
tree26fe17df119dcf9abfd4dfbfbe14325d12cd48f1 /lib/VMCore/Verifier.cpp
parentf7cb6749c9cf17f2127ecab028b1184a987aa42f (diff)
downloadexternal_llvm-f4ea921cc70ce3c8c75cce90af4b672c7f81c7b2.zip
external_llvm-f4ea921cc70ce3c8c75cce90af4b672c7f81c7b2.tar.gz
external_llvm-f4ea921cc70ce3c8c75cce90af4b672c7f81c7b2.tar.bz2
Fix PR826, testcase here: Regression/Verifier/2006-07-11-StoreStruct.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r--lib/VMCore/Verifier.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 9379abc..635f5a2 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -652,10 +652,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.
Assert1(I.getOperand(i) != 0, "Instruction has null operand!", &I);
+
+ // Check to make sure that only first-class-values are operands to
+ // instructions.
+ Assert1(I.getOperand(i)->getType()->isFirstClassType(),
+ "Instruction operands must be first-class values!", &I);
+
if (Function *F = dyn_cast<Function>(I.getOperand(i))) {
+ // Check to make sure that the "address of" an intrinsic function is never
+ // taken.
Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
"Cannot take the address of an intrinsic!", &I);
} else if (BasicBlock *OpBB = dyn_cast<BasicBlock>(I.getOperand(i))) {