File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ - (id)init;
16
16
id
17
17
objc_alloc (Class cls)
18
18
{
19
+ if (UNLIKELY (cls == nil ))
20
+ {
21
+ return nil ;
22
+ }
19
23
if (UNLIKELY (!objc_test_class_flag (cls->isa , objc_class_flag_initialized)))
20
24
{
21
25
objc_send_initialize (cls);
@@ -34,6 +38,10 @@ - (id)init;
34
38
id
35
39
objc_allocWithZone (Class cls)
36
40
{
41
+ if (UNLIKELY (cls == nil ))
42
+ {
43
+ return nil ;
44
+ }
37
45
if (UNLIKELY (!objc_test_class_flag (cls->isa , objc_class_flag_initialized)))
38
46
{
39
47
objc_send_initialize (cls);
@@ -53,6 +61,10 @@ - (id)init;
53
61
id
54
62
objc_alloc_init (Class cls)
55
63
{
64
+ if (UNLIKELY (cls == nil ))
65
+ {
66
+ return nil ;
67
+ }
56
68
id instance = objc_alloc (cls);
57
69
if (objc_test_class_flag (cls, objc_class_flag_fast_alloc_init))
58
70
{
You can’t perform that action at this time.
0 commit comments