ObjFW  Diff

Differences From Artifact [e9f2e9fced]:

To Artifact [ca4604a232]:


29
30
31
32
33
34
35
36

37
38
39

40
41
42

43
44
45
46
47
48
49
29
30
31
32
33
34
35

36
37
38

39
40
41

42
43
44
45
46
47
48
49







-
+


-
+


-
+







void
objc_init_static_instances(struct objc_abi_symtab *symtab)
{
	struct objc_abi_static_instances **staticInstances;

	/* Check if the class for a static instance became available */
	for (size_t i = 0; i < staticInstancesCount; i++) {
		Class cls = objc_lookUpClass(
		Class class = objc_lookUpClass(
		    staticInstancesList[i]->className);

		if (cls != Nil) {
		if (class != Nil) {
			for (id *instances = staticInstancesList[i]->instances;
			    *instances != nil; instances++)
				object_setClass(*instances, cls);
				object_setClass(*instances, class);

			staticInstancesCount--;

			if (staticInstancesCount == 0) {
				free(staticInstancesList);
				staticInstancesList = NULL;
				break;
71
72
73
74
75
76
77
78

79
80

81
82
83

84
85
86
87
88
89
90
71
72
73
74
75
76
77

78
79

80
81
82

83
84
85
86
87
88
89
90







-
+

-
+


-
+







	staticInstances = (struct objc_abi_static_instances **)
	    symtab->defs[symtab->classDefsCount + symtab->categoryDefsCount];

	if (staticInstances == NULL)
		return;

	for (; *staticInstances != NULL; staticInstances++) {
		Class cls = objc_lookUpClass((*staticInstances)->className);
		Class class = objc_lookUpClass((*staticInstances)->className);

		if (cls != Nil) {
		if (class != Nil) {
			for (id *instances = (*staticInstances)->instances;
			    *instances != nil; instances++)
				object_setClass(*instances, cls);
				object_setClass(*instances, class);
		} else {
			staticInstancesList = realloc(staticInstancesList,
			    sizeof(struct objc_abi_static_instances *) *
			    (staticInstancesCount + 1));

			if (staticInstancesList == NULL)
				OBJC_ERROR("Not enough memory for list of "