Harden the Objective-C runtime against weird method

signatures.

<rdar://problem/15631996>

llvm-svn: 197843
This commit is contained in:
Sean Callanan 2013-12-20 23:07:12 +00:00
parent 556b3d69c0
commit fd1ca95331
1 changed files with 6 additions and 0 deletions

View File

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