diff options
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index ab4e478f700..eb40b291b00 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -596,8 +596,9 @@ void Constant::removeDeadConstantUsers() const { } Constant *Constant::replaceUndefsWith(Constant *C, Constant *Replacement) { + assert(C && Replacement && "Expected non-nullptr constant arguments"); Type *Ty = C->getType(); - if (C && match(C, m_Undef())) { + if (match(C, m_Undef())) { assert(Ty == Replacement->getType() && "Expected matching types"); return Replacement; } |