Changes in src/libcfa/exception.c [0304215a:381fdee]
- File:
-
- 1 edited
-
src/libcfa/exception.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/exception.c
r0304215a r381fdee 10 10 // Created On : Mon Jun 26 15:13:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 22 18:17:34201813 // Update Count : 1112 // Last Modified On : Fri Feb 9 14:41:55 2018 13 // Update Count : 8 14 14 // 15 15 … … 52 52 struct __cfaabi_ehm__try_resume_node * current_resume; 53 53 54 exception _t* current_exception;54 exception * current_exception; 55 55 int current_handler_index; 56 56 } shared_stack = {NULL, NULL, 0, 0}; … … 71 71 // This macro should be the only thing that needs to change across machines. Used in the personality function, way down 72 72 // in termination. 73 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception _t*)73 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception *) 74 74 #define MATCHER_FROM_CONTEXT(ptr_to_context) \ 75 (*(_Unwind_Reason_Code(**)(exception _t*))(_Unwind_GetCFA(ptr_to_context) + 8))75 (*(_Unwind_Reason_Code(**)(exception*))(_Unwind_GetCFA(ptr_to_context) + 8)) 76 76 77 77 78 78 // RESUMPTION ================================================================ 79 79 80 void __cfaabi_ehm__throw_resume(exception _t* except) {80 void __cfaabi_ehm__throw_resume(exception * except) { 81 81 82 82 __cfaabi_dbg_print_safe("Throwing resumption exception\n"); … … 106 106 107 107 void __cfaabi_ehm__try_resume_setup(struct __cfaabi_ehm__try_resume_node * node, 108 _Bool (*handler)(exception _t* except)) {108 _Bool (*handler)(exception * except)) { 109 109 node->next = shared_stack.top_resume; 110 110 node->handler = handler; … … 126 126 }; 127 127 128 #define NODE_TO_EXCEPT(node) ((exception _t*)(1 + (node)))128 #define NODE_TO_EXCEPT(node) ((exception *)(1 + (node))) 129 129 #define EXCEPT_TO_NODE(except) ((struct __cfaabi_ehm__node *)(except) - 1) 130 130 131 131 // Creates a copy of the indicated exception and sets current_exception to it. 132 static void __cfaabi_ehm__allocate_exception( exception _t* except ) {132 static void __cfaabi_ehm__allocate_exception( exception * except ) { 133 133 struct exception_context_t * context = this_exception_context(); 134 134 … … 151 151 152 152 // Delete the provided exception, unsetting current_exception if relivant. 153 static void __cfaabi_ehm__delete_exception( exception _t* except ) {153 static void __cfaabi_ehm__delete_exception( exception * except ) { 154 154 struct exception_context_t * context = this_exception_context(); 155 155 … … 179 179 // If this isn't a rethrow (*except==0), delete the provided exception. 180 180 void __cfaabi_ehm__cleanup_terminate( void * except ) { 181 if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception _t**)except );181 if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception**)except ); 182 182 } 183 183 … … 233 233 } 234 234 235 void __cfaabi_ehm__throw_terminate( exception _t* val ) {235 void __cfaabi_ehm__throw_terminate( exception * val ) { 236 236 __cfaabi_dbg_print_safe("Throwing termination exception\n"); 237 237 … … 348 348 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 349 349 350 _Unwind_Reason_Code (*matcher)(exception _t*) =350 _Unwind_Reason_Code (*matcher)(exception *) = 351 351 MATCHER_FROM_CONTEXT(context); 352 352 int index = matcher(shared_stack.current_exception); … … 409 409 __attribute__((noinline)) 410 410 void __cfaabi_ehm__try_terminate(void (*try_block)(), 411 void (*catch_block)(int index, exception _t* except),412 __attribute__((unused)) int (*match_block)(exception _t* except)) {411 void (*catch_block)(int index, exception * except), 412 __attribute__((unused)) int (*match_block)(exception * except)) { 413 413 //! volatile int xy = 0; 414 414 //! printf("%p %p %p %p\n", &try_block, &catch_block, &match_block, &xy);
Note:
See TracChangeset
for help on using the changeset viewer.