Fixed a crash when dealing with an empty method name in the ObjC runtime.
authorSean Callanan <scallanan@apple.com>
Wed, 26 Apr 2017 20:36:47 +0000 (20:36 +0000)
committerSean Callanan <scallanan@apple.com>
Wed, 26 Apr 2017 20:36:47 +0000 (20:36 +0000)
I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable..

<rdar://problem/31793264>

llvm-svn: 301461

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp

index 07b4ae5..e99fd74 100644 (file)
@@ -355,9 +355,14 @@ public:
       }
     }
 
+    clang::IdentifierInfo **identifier_infos = selector_components.data();
+    if (!identifier_infos) {
+      return NULL;
+    }
+
     clang::Selector sel = ast_ctx.Selectors.getSelector(
         is_zero_argument ? 0 : selector_components.size(),
-        selector_components.data());
+        identifier_infos);
 
     clang::QualType ret_type =
         ClangUtil::GetQualType(type_realizer_sp->RealizeType(