ObjFW  Check-in [9027e1ab8d]

Overview
Comment:runtime: Fix initialization of static instances
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9027e1ab8dc36f690216b67f2cacd2be6ad5206351ae153095943af5a4f027fc
User & Date: js on 2017-06-11 01:24:13
Other Links: manifest | tags
Context
2017-06-11
02:34
OFFile: Rework handle on MorphOS check-in: a9b2bd12eb user: js tags: trunk
01:24
runtime: Fix initialization of static instances check-in: 9027e1ab8d user: js tags: trunk
00:55
Revert ea28728a check-in: f1f934186e user: js tags: trunk
Changes

Modified src/runtime/static-instances.m from [e637d2916b] to [7559b44b68].

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59






60
61
62
63
64
65
66
				object_setClass(*instances, cls);

			static_instances_cnt--;

			if (static_instances_cnt == 0) {
				free(static_instances);
				static_instances = NULL;
				continue;
			}

			static_instances[i] =
			    static_instances[static_instances_cnt];

			static_instances = realloc(static_instances,
			    sizeof(struct objc_abi_static_instances *) *
			    static_instances_cnt);

			if (static_instances == NULL)
				OBJC_ERROR("Not enough memory for list of "
				    "static instances!");






		}
	}

	si = (struct objc_abi_static_instances **)
	    symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt];

	if (si == NULL)







|












>
>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
				object_setClass(*instances, cls);

			static_instances_cnt--;

			if (static_instances_cnt == 0) {
				free(static_instances);
				static_instances = NULL;
				break;
			}

			static_instances[i] =
			    static_instances[static_instances_cnt];

			static_instances = realloc(static_instances,
			    sizeof(struct objc_abi_static_instances *) *
			    static_instances_cnt);

			if (static_instances == NULL)
				OBJC_ERROR("Not enough memory for list of "
				    "static instances!");

			/*
			 * We moved the last entry to the current index,
			 * therefore we need to run again for the current index.
			 */
			i--;
		}
	}

	si = (struct objc_abi_static_instances **)
	    symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt];

	if (si == NULL)