diff options
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 371500bc78..cdf7b76dd0 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2444,7 +2444,7 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal, Constant *Val = getVal(Values, MSI->getValue()); Constant *DestVal = ComputeLoadResult(getVal(Values, Ptr), MutatedMemory); - if (Val->isNullValue() && DestVal->isNullValue()) { + if (Val->isNullValue() && DestVal && DestVal->isNullValue()) { // This memset is a no-op. ++CurInst; continue; |