ObjFW  Check-in [ebaf70c292]

Overview
Comment:exception.m: Handle empty class names.

m68k seems to use an empty class name instead of NULL.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ebaf70c292bdfc5063a10e02f33decbe6d94b43fe64b1ad56961d064905ecc5a
User & Date: js on 2013-01-13 16:10:24
Other Links: manifest | tags
Context
2013-01-13
16:10
PLATFORMS.md: Add Linux/m68k. check-in: 3d8fb22695 user: js tags: trunk
16:10
exception.m: Handle empty class names. check-in: ebaf70c292 user: js tags: trunk
14:59
Make it possible to stop run loops. check-in: 3c6ad38d92 user: js tags: trunk
Changes

Modified src/runtime/exception.m from [d79be2163d] to [375c6e97c6].

412
413
414
415
416
417
418

419
420
421
422
423
424
425
		 */
		actionrecords = ptr;
		displacement = (intptr_t)read_sleb128(&ptr);
		actionrecords += displacement;

		if (filter > 0 && !(actions & _UA_FORCE_UNWIND) && !foreign) {
			Class class;

			uintptr_t c;
			const uint8_t *tmp;

#if defined(__arm__) || defined(__ARM__)
			tmp = lsda->typestable - (filter * 4);
			c = *(uintptr_t*)(void*)tmp;








>







412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
		 */
		actionrecords = ptr;
		displacement = (intptr_t)read_sleb128(&ptr);
		actionrecords += displacement;

		if (filter > 0 && !(actions & _UA_FORCE_UNWIND) && !foreign) {
			Class class;
			const char *className;
			uintptr_t c;
			const uint8_t *tmp;

#if defined(__arm__) || defined(__ARM__)
			tmp = lsda->typestable - (filter * 4);
			c = *(uintptr_t*)(void*)tmp;

433
434
435
436
437
438
439

440

441
442
443
444
445
446
447
448
			i = filter * size_for_encoding(lsda->typestable_enc);
			tmp = lsda->typestable - i;
			c = (uintptr_t)read_value(lsda->typestable_enc, &tmp);
			c = (uintptr_t)resolve_value(c, lsda->typestable_enc,
			    lsda->typestable - i, lsda->typestable_base);
#endif


			if (c != 0)

				class = objc_getRequiredClass((const char*)c);
			else
				class = Nil;

			if (class_matches(class, e->object)) {
				*filtervalue = filter;
				return HANDLER_FOUND;
			}







>
|
>
|







434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
			i = filter * size_for_encoding(lsda->typestable_enc);
			tmp = lsda->typestable - i;
			c = (uintptr_t)read_value(lsda->typestable_enc, &tmp);
			c = (uintptr_t)resolve_value(c, lsda->typestable_enc,
			    lsda->typestable - i, lsda->typestable_base);
#endif

			className = (const char*)c;

			if (className != NULL && *className != '\0')
				class = objc_getRequiredClass(className);
			else
				class = Nil;

			if (class_matches(class, e->object)) {
				*filtervalue = filter;
				return HANDLER_FOUND;
			}