mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Make the verifier reject instructions which have null pointers
for operands: rdar://6179606. no testcase, because I can't write a .ll file that is this broken ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e1ef3e2bd
commit
cad208b8bc
@ -224,6 +224,10 @@ namespace {
|
||||
void visitGlobalAlias(GlobalAlias &GA);
|
||||
void visitFunction(Function &F);
|
||||
void visitBasicBlock(BasicBlock &BB);
|
||||
using InstVisitor<Verifier>::visit;
|
||||
|
||||
void visit(Instruction &I);
|
||||
|
||||
void visitTruncInst(TruncInst &I);
|
||||
void visitZExtInst(ZExtInst &I);
|
||||
void visitSExtInst(SExtInst &I);
|
||||
@ -326,6 +330,13 @@ static RegisterPass<Verifier> X("verify", "Module Verifier");
|
||||
do { if (!(C)) { CheckFailed(M, V1, V2, V3, V4); return; } } while (0)
|
||||
|
||||
|
||||
void Verifier::visit(Instruction &I) {
|
||||
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
|
||||
Assert1(I.getOperand(i) != 0, "Operand is null", &I);
|
||||
InstVisitor<Verifier>::visit(I);
|
||||
}
|
||||
|
||||
|
||||
void Verifier::visitGlobalValue(GlobalValue &GV) {
|
||||
Assert1(!GV.isDeclaration() ||
|
||||
GV.hasExternalLinkage() ||
|
||||
|
Loading…
Reference in New Issue
Block a user