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:
parent
73c44eede5
commit
38c6f227ec
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user