- Timestamp:
- Apr 2, 2020, 3:00:55 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0f3d844
- Parents:
- 6d43cdde
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.c
r6d43cdde r3eb5a478 10 10 // Created On : Mon Jun 26 15:13:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Mar 27 10:19:00 202013 // Update Count : 1 212 // Last Modified On : Thr Apr 02 14:47:00 2020 13 // Update Count : 13 14 14 // 15 15 … … 53 53 // Temperary global exception context. Does not work with concurency. 54 54 struct exception_context_t { 55 struct __cfaehm_try_resume_node * top_resume; 56 struct __cfaehm_try_resume_node * current_resume; 57 58 exception_t * current_exception; 59 int current_handler_index; 60 } static shared_stack = {NULL, NULL, NULL, 0}; 55 struct __cfaehm_try_resume_node * top_resume; 56 57 exception_t * current_exception; 58 int current_handler_index; 59 } static shared_stack = {NULL, NULL, 0}; 61 60 62 61 // Get the current exception context. … … 75 74 __cfaabi_dbg_print_safe("Throwing resumption exception\n"); 76 75 77 struct __cfaehm_try_resume_node * original_head = context->current_resume; 78 struct __cfaehm_try_resume_node * current = 79 (original_head) ? original_head->next : context->top_resume; 76 struct __cfaehm_try_resume_node * original_head = context->top_resume; 77 struct __cfaehm_try_resume_node * current = context->top_resume; 80 78 81 79 for ( ; current ; current = current->next) { 82 context-> current_resume = current;80 context->top_resume = current->next; 83 81 if (current->handler(except)) { 84 context-> current_resume = original_head;82 context->top_resume = original_head; 85 83 return; 86 84 } … … 88 86 89 87 __cfaabi_dbg_print_safe("Unhandled exception\n"); 90 context-> current_resume = original_head;88 context->top_resume = original_head; 91 89 92 90 // Fall back to termination:
Note: See TracChangeset
for help on using the changeset viewer.