summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index eb40b291b00..a6a8eaac2f9 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -611,7 +611,7 @@ Constant *Constant::replaceUndefsWith(Constant *C, Constant *Replacement) {
SmallVector<Constant *, 32> NewC(NumElts);
for (unsigned i = 0; i != NumElts; ++i) {
Constant *EltC = C->getAggregateElement(i);
- assert(EltC->getType() == Replacement->getType() &&
+ assert((!EltC || EltC->getType() == Replacement->getType()) &&
"Expected matching types");
NewC[i] = EltC && match(EltC, m_Undef()) ? Replacement : EltC;
}
OpenPOWER on IntegriCloud