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 | eb953f0ef83aca0f6d695584bc7c40b766708539 (patch) | |
| tree | 279b0f4d373379da60d62657867efb4d4a4c4424 /llvm/lib/Transforms | |
| parent | b1fb4da2714e7fa669447fe8b822381477cf5be9 (diff) | |
| download | bcm5719-llvm-eb953f0ef83aca0f6d695584bc7c40b766708539.tar.gz bcm5719-llvm-eb953f0ef83aca0f6d695584bc7c40b766708539.zip | |
Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632.
llvm-svn: 23484
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 3b2eee05314..839d7769ef7 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/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); |

