Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r13600e8 r8108ba8  
    99// Author           : Andrew Beach
    1010// Created On       : Mon Jun 26 15:13:00 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 10 16:45:22 2023
    13 // Update Count     : 69
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Feb 24 13:40:00 2021
     13// Update Count     : 36
    1414//
    1515
     
    2727#include "stdhdr/assert.h"
    2828#include "virtual.h"
    29 
    30 extern void __cabi_abort( const char fmt[], ... );
    3129
    3230#pragma GCC visibility push(default)
     
    125123
    126124// Creates a copy of the indicated exception and sets current_exception to it.
    127 void __cfaehm_allocate_exception( exception_t * except ) {
     125static void __cfaehm_allocate_exception( exception_t * except ) {
    128126        struct exception_context_t * context = this_exception_context();
    129127
     
    194192
    195193        if ( actions & _UA_END_OF_STACK ) {
    196                 __cabi_abort(
    197                         "Propagation failed to find a matching handler.\n"
    198                         "Possible cause is a missing try block with appropriate catch clause for specified exception type.\n"
    199                         "Last exception name or message: %s.\n",
    200                         NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) )->
    201                                 virtual_table->msg( NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) ) )
    202                 );
     194                abort();
    203195        } else {
    204196                return _URC_NO_REASON;
     
    217209        struct exception_context_t * context = this_exception_context();
    218210        struct __cfaehm_node * node = EXCEPT_TO_NODE(context->current_exception);
     211
     212        // Preform clean-up of any extra active exceptions.
     213        while ( node->next ) {
     214                struct __cfaehm_node * to_free = node->next;
     215                node->next = to_free->next;
     216                exception_t * except = NODE_TO_EXCEPT( to_free );
     217                except->virtual_table->free( except );
     218            free( to_free );
     219        }
    219220
    220221        _Unwind_Reason_Code ret;
     
    238239
    239240// The exception that is being thrown must already be stored.
    240 void __cfaehm_begin_unwind(void(*defaultHandler)(exception_t *)) {
     241static void __cfaehm_begin_unwind(void(*defaultHandler)(exception_t *)) {
    241242        struct exception_context_t * context = this_exception_context();
    242243        if ( NULL == context->current_exception ) {
     
    567568        "       .hidden CFA.ref.__gcfa_personality_v0\n"
    568569        "       .weak   CFA.ref.__gcfa_personality_v0\n"
     570        // No clue what this does specifically
     571        "       .section        .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n"
    569572#if defined( __x86_64 ) || defined( __i386 )
    570573        "       .align 8\n"
Note: See TracChangeset for help on using the changeset viewer.