[llvm] d4d1caa - Fix MSan crash after 1977c53b

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Sat May 1 21:44:55 PDT 2021


Author: Juneyoung Lee
Date: 2021-05-02T13:44:43+09:00
New Revision: d4d1caafc8d12d5df5c98b2aec5acf5c10ea22d1

URL: https://github.com/llvm/llvm-project/commit/d4d1caafc8d12d5df5c98b2aec5acf5c10ea22d1
DIFF: https://github.com/llvm/llvm-project/commit/d4d1caafc8d12d5df5c98b2aec5acf5c10ea22d1.diff

LOG: Fix MSan crash after 1977c53b

Added: 
    

Modified: 
    llvm/lib/Analysis/OverflowInstAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/OverflowInstAnalysis.cpp b/llvm/lib/Analysis/OverflowInstAnalysis.cpp
index 2456ae9dd281..9f17d5b2064d 100644
--- a/llvm/lib/Analysis/OverflowInstAnalysis.cpp
+++ b/llvm/lib/Analysis/OverflowInstAnalysis.cpp
@@ -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;
 


        


More information about the llvm-commits mailing list