summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-11-22 22:30:10 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-11-22 22:30:10 +0000
commit59c11686cc5fc169ff0e0612de9b4c80b06628bb (patch)
tree0e86621eea283430231954826991a8baff6e06b2 /llvm/lib/Transforms
parenta915b538d3bc07783bb07854e18b0e895811378d (diff)
downloadbcm5719-llvm-59c11686cc5fc169ff0e0612de9b4c80b06628bb.tar.gz
bcm5719-llvm-59c11686cc5fc169ff0e0612de9b4c80b06628bb.zip
Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)
llvm-svn: 44281
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index 38bf0610b38..ebd8a595f21 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -59,6 +59,10 @@ bool SimpleInliner::doInitialization(CallGraph &CG) {
if (GV == 0)
return false;
+ // Don't crash on invalid code
+ if (!GV->hasInitializer())
+ return false;
+
const ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
if (InitList == 0)
OpenPOWER on IntegriCloud