[ORC] Don't call isa<> on a null value.

This should fix the recent builder failures in the test-global-ctors.ll testcase.

llvm-svn: 335680
This commit is contained in:
Lang Hames 2018-06-26 22:43:01 +00:00
parent 8f9dbb1d64
commit 2f17824463
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ CtorDtorIterator::Element CtorDtorIterator::operator*() const {
ConstantInt *Priority = dyn_cast<ConstantInt>(CS->getOperand(0)); ConstantInt *Priority = dyn_cast<ConstantInt>(CS->getOperand(0));
Value *Data = CS->getNumOperands() == 3 ? CS->getOperand(2) : nullptr; Value *Data = CS->getNumOperands() == 3 ? CS->getOperand(2) : nullptr;
if (!isa<GlobalValue>(Data)) if (Data && !isa<GlobalValue>(Data))
Data = nullptr; Data = nullptr;
return Element(Priority->getZExtValue(), Func, Data); return Element(Priority->getZExtValue(), Func, Data);
} }