aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-29 19:33:36 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-29 19:33:36 +0000
commitbcb85087a7f281dcc85b04f82be3a79ff9387fc5 (patch)
tree405c2274b8647f830fafa8101fa0fa95cf46bcc8
parent1f237b00279ada1ccce35ab924a7f797d9dea25d (diff)
Don't crash owhen ComputeLoadResult can't compute the result of the load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132290 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
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;