ObjFW  Check-in [68eef83aae]

Overview
Comment:runtime: Fix double initialization
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 68eef83aae733bb03d91c8865e20da682f940f109eb532e83720bdf501a5172f
User & Date: js on 2020-12-21 22:22:30
Other Links: manifest | tags
Context
2020-12-21
22:22
Fix missing static check-in: b70dcd58e9 user: js tags: trunk
22:22
runtime: Fix double initialization check-in: 68eef83aae user: js tags: trunk
21:48
runtime: Use MessageBox() for errors on Windows check-in: fedc7e9458 user: js tags: trunk
Changes

Modified src/runtime/class.m from [0b3dadf0dd] to [c47f6af2b8].

339
340
341
342
343
344
345







346
347
348
349
350
351
352
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359







+
+
+
+
+
+
+








	if (class->info & OBJC_CLASS_INFO_INITIALIZED)
		return;

	if (class->superclass)
		initializeClass(class->superclass);

	/*
	 * Avoid double-initialization: One of the superclasses' +[initialize]
	 * might have called this class and hence it already got initialized.
	 */
	if (class->info & OBJC_CLASS_INFO_INITIALIZED)
		return;

	class->info |= OBJC_CLASS_INFO_DTABLE;
	class->isa->info |= OBJC_CLASS_INFO_DTABLE;

	objc_update_dtable(class);
	objc_update_dtable(class->isa);

	/*