From fd1ca95331d9039a28a4fb868f0332899b38a13a Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Fri, 20 Dec 2013 23:07:12 +0000 Subject: [PATCH] Harden the Objective-C runtime against weird method signatures. llvm-svn: 197843 --- .../ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp index 5a5fb4649780..9ddd2ac3d387 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp @@ -528,6 +528,9 @@ AppleObjCTypeVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) auto instance_method_func = [log, interface_decl, this](const char *name, const char *types) -> bool { + if (!name || !types) + return false; // skip this one + ObjCRuntimeMethodType method_type(types); clang::ObjCMethodDecl *method_decl = method_type.BuildMethod (interface_decl, name, true); @@ -543,6 +546,9 @@ AppleObjCTypeVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) auto class_method_func = [log, interface_decl, this](const char *name, const char *types) -> bool { + if (!name || !types) + return false; // skip this one + ObjCRuntimeMethodType method_type(types); clang::ObjCMethodDecl *method_decl = method_type.BuildMethod (interface_decl, name, false);