diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-27 22:28:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-27 22:28:11 +0000 |
commit | 9a5582f2516634f5b66c9bbdbab5360d6eb3ef35 (patch) | |
tree | de896b327e5efd378ce1e1b862f4f514a90ba56c | |
parent | ee35a4f9580edfb8683f15fb848e80ff7b438abb (diff) | |
download | external_llvm-9a5582f2516634f5b66c9bbdbab5360d6eb3ef35.zip external_llvm-9a5582f2516634f5b66c9bbdbab5360d6eb3ef35.tar.gz external_llvm-9a5582f2516634f5b66c9bbdbab5360d6eb3ef35.tar.bz2 |
Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23484 91177308-0d34-0410-b5e6-96231b3b80d8
-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 3b2eee0..839d776 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -337,7 +337,7 @@ static bool CleanupConstantGlobalUsers(Value *V, Constant *Init) { Constant *SubInit = 0; ConstantExpr *CE = dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP)); - if (CE && CE->getOpcode() == Instruction::GetElementPtr) + if (Init && CE && CE->getOpcode() == Instruction::GetElementPtr) SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE); Changed |= CleanupConstantGlobalUsers(GEP, SubInit); |