Fix MSan crash after 1977c53b
authorJuneyoung Lee <aqjune@gmail.com>
Sun, 2 May 2021 04:44:43 +0000 (13:44 +0900)
committerJuneyoung Lee <aqjune@gmail.com>
Sun, 2 May 2021 04:44:43 +0000 (13:44 +0900)
llvm/lib/Analysis/OverflowInstAnalysis.cpp

index 2456ae9..9f17d5b 100644 (file)
@@ -38,7 +38,8 @@ bool llvm::isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd,
       return false;
 
     II = dyn_cast<IntrinsicInst>(Extract->getAggregateOperand());
-    if (!match(II, m_CombineOr(m_Intrinsic<Intrinsic::umul_with_overflow>(),
+    if (!II ||
+        !match(II, m_CombineOr(m_Intrinsic<Intrinsic::umul_with_overflow>(),
                                m_Intrinsic<Intrinsic::smul_with_overflow>())))
       return false;