[llvm-commits] [llvm] r44281 - /llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp

Anton Korobeynikov asl at math.spbu.ru
Thu Nov 22 14:30:12 PST 2007


Author: asl
Date: Thu Nov 22 16:30:10 2007
New Revision: 44281

URL: http://llvm.org/viewvc/llvm-project?rev=44281&view=rev
Log:
Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)

Modified:
    llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp

Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=44281&r1=44280&r2=44281&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Thu Nov 22 16:30:10 2007
@@ -59,6 +59,10 @@
   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)





More information about the llvm-commits mailing list