projects
/
llvm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e7c700
)
ConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 24 Sep 2019 12:30:13 +0000
(12:30 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 24 Sep 2019 12:30:13 +0000
(12:30 +0000)
Early out if the vector element is not Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372743
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/IR/ConstantFold.cpp
patch
|
blob
|
history
diff --git
a/lib/IR/ConstantFold.cpp
b/lib/IR/ConstantFold.cpp
index 835fbb3443b8fb8be02c870cef634f5a340cca1b..ee0ad322f4edc67bf4f374524f65bc2afb998b59 100644
(file)
--- a/
lib/IR/ConstantFold.cpp
+++ b/
lib/IR/ConstantFold.cpp
@@
-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)) {