Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2007-11-22 22:30:10 +00:00
parent 73d4bb6676
commit 311c4b6e98

View File

@ -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)