From d838f7ad2899d99107ac956f83d97d0668e64e02 Mon Sep 17 00:00:00 2001 From: theraven Date: Thu, 18 Jul 2013 09:14:02 +0000 Subject: [PATCH] Don't crash when trying to synchronize on nil (but don't do anything sensible either). --- associate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/associate.m b/associate.m index 2289dca..0343363 100644 --- a/associate.m +++ b/associate.m @@ -361,7 +361,7 @@ PRIVATE void gc_setTypeForClass(Class cls, void *type) int objc_sync_enter(id object) { - if (isSmallObject(object)) { return 0; } + if ((object == 0) || isSmallObject(object)) { return 0; } struct reference_list *list = referenceListForObject(object, YES); LOCK(&list->lock); return 0; @@ -369,7 +369,7 @@ int objc_sync_enter(id object) int objc_sync_exit(id object) { - if (isSmallObject(object)) { return 0; } + if ((object == 0) || isSmallObject(object)) { return 0; } struct reference_list *list = referenceListForObject(object, NO); if (NULL != list) {