diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-01-01 22:31:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-01-01 22:31:46 +0000 |
| commit | d91ed10b7028c8470c8a9b7fa61a712d04ab07d9 (patch) | |
| tree | fb9d11e0782f1d03a20e09d2d5d041486f153535 /lib/Transforms/IPO/GlobalOpt.cpp | |
| parent | 1acf707cce74f80af80324737a51d43496a03355 (diff) | |
fix a globalopt crash on two Adobe-C++ testcases that the recent
loop idiom pass exposed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
| -rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index f8064352fb..c55ee563ba 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -167,6 +167,11 @@ static bool AnalyzeGlobal(const Value *V, GlobalStatus &GS, const User *U = *UI; if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { GS.HasNonInstructionUser = true; + + // If the result of the constantexpr isn't pointer type, then we won't + // know to expect it in various places. Just reject early. + if (!isa<PointerType>(CE->getType())) return true; + if (AnalyzeGlobal(CE, GS, PHIUsers)) return true; } else if (const Instruction *I = dyn_cast<Instruction>(U)) { if (!GS.HasMultipleAccessingFunctions) { |
