ObjFW  Check-in [b2deb6c291]

Overview
Comment:exception.m: Fix cleanup.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b2deb6c291eddbe2576dd3751e769f0a6e0af04a529282d58d03898f768974f4
User & Date: js on 2012-08-20 00:20:12
Other Links: manifest | tags
Context
2012-08-20
08:14
A few renames in OFFile. check-in: c492171577 user: js tags: trunk
00:20
exception.m: Fix cleanup. check-in: b2deb6c291 user: js tags: trunk
2012-08-19
23:26
Get rid of OFAutoreleasePool in of_asprintf. check-in: 5f04d5b720 user: js tags: trunk
Changes

Modified src/runtime/exception.m from [757d54b209] to [738962e0b5].

535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562


563
564
565
566
567


568
569
570
571
572
573
574

	if (landingpad != 0 && actionrecords == NULL)
		found = CLEANUP_FOUND;
	else if (landingpad != 0)
		found = find_actionrecord(actionrecords, &lsda, actions,
		    foreign, e, &filter);

	if (!found)
		CONTINUE_UNWIND;

	if (actions & _UA_SEARCH_PHASE) {
		if (!(found & HANDLER_FOUND))
			CONTINUE_UNWIND;

		/* Cache it so we don't have to search it again in phase 2 */
		if (!foreign) {
#if defined(__arm__) || defined(__ARM__)
			ex->barrier_cache.sp = _Unwind_GetGR(ctx, 13);
			ex->barrier_cache.bitpattern[1] = filter;
			ex->barrier_cache.bitpattern[3] = landingpad;
#else
			e->landingpad = landingpad;
			e->filter = filter;
#endif
		}

		return _URC_HANDLER_FOUND;
	} else if (actions & _UA_CLEANUP_PHASE) {


		/* For cleanup, reg #0 must be the exception and reg #1 zero */
		_Unwind_SetGR(ctx, __builtin_eh_return_data_regno(0),
		    (uintptr_t)e);
		_Unwind_SetGR(ctx, __builtin_eh_return_data_regno(1), 0);
		_Unwind_SetIP(ctx, landingpad);



		return _URC_INSTALL_CONTEXT;
	}

	abort();
}








|







<

|
|
|

|
|

<



>
>
|

|
|

>
>







535
536
537
538
539
540
541
542
543
544
545
546
547
548
549

550
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576

	if (landingpad != 0 && actionrecords == NULL)
		found = CLEANUP_FOUND;
	else if (landingpad != 0)
		found = find_actionrecord(actionrecords, &lsda, actions,
		    foreign, e, &filter);

	if (!found || foreign)
		CONTINUE_UNWIND;

	if (actions & _UA_SEARCH_PHASE) {
		if (!(found & HANDLER_FOUND))
			CONTINUE_UNWIND;

		/* Cache it so we don't have to search it again in phase 2 */

#if defined(__arm__) || defined(__ARM__)
		ex->barrier_cache.sp = _Unwind_GetGR(ctx, 13);
		ex->barrier_cache.bitpattern[1] = filter;
		ex->barrier_cache.bitpattern[3] = landingpad;
#else
		e->landingpad = landingpad;
		e->filter = filter;
#endif


		return _URC_HANDLER_FOUND;
	} else if (actions & _UA_CLEANUP_PHASE) {
		if (!(found & CLEANUP_FOUND))
			CONTINUE_UNWIND;

		_Unwind_SetGR(ctx, __builtin_eh_return_data_regno(0),
		    (uintptr_t)e->object);
		_Unwind_SetGR(ctx, __builtin_eh_return_data_regno(1), filter);
		_Unwind_SetIP(ctx, landingpad);

		free(ex);

		return _URC_INSTALL_CONTEXT;
	}

	abort();
}