[llvm] r335680 - [ORC] Don't call isa<> on a null value.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 26 15:43:01 PDT 2018
Author: lhames
Date: Tue Jun 26 15:43:01 2018
New Revision: 335680
URL: http://llvm.org/viewvc/llvm-project?rev=335680&view=rev
Log:
[ORC] Don't call isa<> on a null value.
This should fix the recent builder failures in the test-global-ctors.ll testcase.
Modified:
llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
Modified: llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp?rev=335680&r1=335679&r2=335680&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/ExecutionUtils.cpp Tue Jun 26 15:43:01 2018
@@ -109,7 +109,7 @@ CtorDtorIterator::Element CtorDtorIterat
ConstantInt *Priority = dyn_cast<ConstantInt>(CS->getOperand(0));
Value *Data = CS->getNumOperands() == 3 ? CS->getOperand(2) : nullptr;
- if (!isa<GlobalValue>(Data))
+ if (Data && !isa<GlobalValue>(Data))
Data = nullptr;
return Element(Priority->getZExtValue(), Func, Data);
}
More information about the llvm-commits
mailing list