diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-07-11 20:29:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-07-11 20:29:49 +0000 |
| commit | b7e1ef54afc39f9c44fe02f770271dce18b7466c (patch) | |
| tree | fb637f24800b31cf588e81d7a46b98e04983e103 /llvm/lib | |
| parent | 7a00b86720318b995fdf3e89d9a44bd038aaa7ae (diff) | |
| download | bcm5719-llvm-b7e1ef54afc39f9c44fe02f770271dce18b7466c.tar.gz bcm5719-llvm-b7e1ef54afc39f9c44fe02f770271dce18b7466c.zip | |
Fix PR826, testcase here: Regression/Verifier/2006-07-11-StoreStruct.ll
llvm-svn: 29112
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 9379abcfd18..635f5a25edf 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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))) { |

