aboutsummaryrefslogtreecommitdiff
path: root/libobjc/protocols.c
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-10-12 22:00:01 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-10-12 22:00:01 +0000
commitad9eef11dfc362261d3de4231eab7eac352d7f9f (patch)
treec1e1a95aab3eeed0bec8d3d90946e13dff607e7d /libobjc/protocols.c
parentd761137fee594ee61ab14d121bdac9e051d67b07 (diff)
downloadgcc-ad9eef11dfc362261d3de4231eab7eac352d7f9f.zip
gcc-ad9eef11dfc362261d3de4231eab7eac352d7f9f.tar.gz
gcc-ad9eef11dfc362261d3de4231eab7eac352d7f9f.tar.bz2
Makefile.in (C_SOURCE_FILES): Added methods.c.
2010-10-12 Nicola Pero <nicola.pero@meta-innovation.com> * Makefile.in (C_SOURCE_FILES): Added methods.c. * encoding.c (method_getNumberOfArguments): New. (method_get_number_of_arguments): Call method_getNumberOfArguments. * ivars.c (ivar_getName): Check for NULL variable argument. (ivar_getOffset): Check for NULL variable argument. (ivar_getTypeEncoding): Check for NULL variable argument. (class_copyIvarList): New. * methods.c: New. * protocols.c (class_copyProtocolList): Check for Nil class_ argument. * sendmsg.c: Use 'struct objc_method *' instead of Method_t, and 'struct objc_method_list *' instead of MethodList_t. (class_getMethodImplementation): New. (class_respondsToSelector): New. (class_getInstanceMethod): New. (class_getClassMethod): New. * objc/runtime.h: Updated comments. (class_copyIvarList): New. (class_getInstanceMethod): New. (class_getClassMethod): New. (class_getMethodImplementation): New. (class_respondsToSelector): New. (method_getName): New. (method_getImplementation): New. (method_getTypeEncoding): New. (class_copyMethodList): New. (method_getNumberOfArguments): New. From-SVN: r165400
Diffstat (limited to 'libobjc/protocols.c')
-rw-r--r--libobjc/protocols.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libobjc/protocols.c b/libobjc/protocols.c
index 6d42980..bc714ae 100644
--- a/libobjc/protocols.c
+++ b/libobjc/protocols.c
@@ -211,6 +211,13 @@ class_copyProtocolList (Class class_, unsigned int *numberOfReturnedProtocols)
Protocol **returnValue = NULL;
struct objc_protocol_list* proto_list;
+ if (class_ == Nil)
+ {
+ if (numberOfReturnedProtocols)
+ *numberOfReturnedProtocols = 0;
+ return NULL;
+ }
+
/* Lock the runtime mutex because the class protocols may be
concurrently modified. */
objc_mutex_lock (__objc_runtime_mutex);