Differences From Artifact [738962e0b5]:
- File src/runtime/exception.m — part of check-in [b2deb6c291] at 2012-08-20 00:20:12 on branch trunk — exception.m: Fix cleanup. (user: js, size: 14305) [annotate] [blame] [check-ins using]
To Artifact [ef3f114f24]:
- File
src/runtime/exception.m
— part of check-in
[aecc08c367]
at
2012-09-06 19:13:50
on branch trunk
— A few small exception fixes.
This partly reverts 93dad6d, as it did fix ARC + -fobjc-arc-exceptions
with Clang, but broke exceptions in general with GCC. (user: js, size: 14250) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
394 395 396 397 398 399 400 | return NO; } static uint8_t find_actionrecord(const uint8_t *actionrecords, struct lsda *lsda, int actions, BOOL foreign, struct objc_exception *e, intptr_t *filtervalue) { | < | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | return NO; } static uint8_t find_actionrecord(const uint8_t *actionrecords, struct lsda *lsda, int actions, BOOL foreign, struct objc_exception *e, intptr_t *filtervalue) { const uint8_t *ptr; intptr_t filter, displacement; do { ptr = actionrecords; filter = (intptr_t)read_sleb128(&ptr); |
︙ | ︙ | |||
438 439 440 441 442 443 444 | lsda->typestable - i, lsda->typestable_base); #endif class = (c != 0 ? objc_get_class((const char*)c) : Nil); if (class_matches(class, e->object)) { *filtervalue = filter; | | | | | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | lsda->typestable - i, lsda->typestable_base); #endif class = (c != 0 ? objc_get_class((const char*)c) : Nil); if (class_matches(class, e->object)) { *filtervalue = filter; return HANDLER_FOUND; } } else if (filter == 0) return CLEANUP_FOUND; else abort(); } while (displacement != 0); return 0; } #if defined(__arm__) || defined(__ARM__) _Unwind_Reason_Code __gnu_objc_personality_v0(uint32_t state, struct _Unwind_Exception *ex, struct _Unwind_Context *ctx) { |
︙ | ︙ | |||
535 536 537 538 539 540 541 | if (landingpad != 0 && actionrecords == NULL) found = CLEANUP_FOUND; else if (landingpad != 0) found = find_actionrecord(actionrecords, &lsda, actions, foreign, e, &filter); | | | | < | 534 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) || foreign) 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)ex); _Unwind_SetGR(ctx, __builtin_eh_return_data_regno(1), filter); _Unwind_SetIP(ctx, landingpad); return _URC_INSTALL_CONTEXT; } abort(); } |
︙ | ︙ |