Don't create a StringRef with a NULL value.
authorBill Wendling <isanbard@gmail.com>
Tue, 11 May 2010 01:33:39 +0000 (01:33 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 11 May 2010 01:33:39 +0000 (01:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103455 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SubtargetFeature.cpp

index 035e64a017b197456e40e4cc5bbd7306892093da..113cd5b7b3ef07ece404fd6084fcf261de4ec492 100644 (file)
@@ -389,6 +389,8 @@ void SubtargetFeatures::getDefaultSubtargetFeatures(const std::string &CPU,
     break;
   }
 
+  if (!Attrs) return;
+
   StringRef SR(Attrs);
 
   while (!SR.empty()) {