1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

ConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Early out if the vector element is not Constant.

llvm-svn: 372743
This commit is contained in:
Simon Pilgrim 2019-09-24 12:30:13 +00:00
parent 73c44eede5
commit 38c6f227ec

View File

@ -747,6 +747,7 @@ Constant *llvm::ConstantFoldSelectInstruction(Constant *Cond,
Constant *V2Element = ConstantExpr::getExtractElement(V2,
ConstantInt::get(Ty, i));
Constant *Cond = dyn_cast<Constant>(CondV->getOperand(i));
if (!Cond) break;
if (V1Element == V2Element) {
V = V1Element;
} else if (isa<UndefValue>(Cond)) {