Changeset 856dff8 for libcfa/src/exception.c
- Timestamp:
- Aug 28, 2020, 11:15:36 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3b2f41e
- Parents:
- b7fe2e6 (diff), 8e2cb4a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.c
rb7fe2e6 r856dff8 209 209 void * stop_param) { 210 210 // Verify actions follow the rules we expect. 211 verify((actions & _UA_CLEANUP_PHASE) && (actions & _UA_FORCE_UNWIND)); 212 verify(!(actions & (_UA_SEARCH_PHASE | _UA_HANDLER_FRAME))); 211 verify(actions & _UA_CLEANUP_PHASE); 212 verify(actions & _UA_FORCE_UNWIND); 213 verify(!(actions & _UA_SEARCH_PHASE)); 214 verify(!(actions & _UA_HANDLER_FRAME)); 213 215 214 216 if ( actions & _UA_END_OF_STACK ) { 215 exit(1);217 abort(); 216 218 } else { 217 219 return _URC_NO_REASON; … … 219 221 } 220 222 221 static struct _Unwind_Exception cancel_exception_storage; 223 __attribute__((weak)) _Unwind_Reason_Code 224 __cfaehm_cancellation_unwind( struct _Unwind_Exception * exception ) { 225 return _Unwind_ForcedUnwind( exception, _Stop_Fn, (void*)0x22 ); 226 } 222 227 223 228 // Cancel the current stack, prefroming approprate clean-up and messaging. 224 229 void __cfaehm_cancel_stack( exception_t * exception ) { 225 // TODO: Detect current stack and pick a particular stop-function. 230 __cfaehm_allocate_exception( exception ); 231 232 struct exception_context_t * context = this_exception_context(); 233 struct __cfaehm_node * node = EXCEPT_TO_NODE(context->current_exception); 234 235 // Preform clean-up of any extra active exceptions. 236 while ( node->next ) { 237 struct __cfaehm_node * to_free = node->next; 238 node->next = to_free->next; 239 exception_t * except = NODE_TO_EXCEPT( to_free ); 240 except->virtual_table->free( except ); 241 free( to_free ); 242 } 243 226 244 _Unwind_Reason_Code ret; 227 ret = _ Unwind_ForcedUnwind( &cancel_exception_storage, _Stop_Fn, (void*)0x22);245 ret = __cfaehm_cancellation_unwind( &node->unwind_exception ); 228 246 printf("UNWIND ERROR %d after force unwind\n", ret); 229 247 abort();
Note: See TracChangeset
for help on using the changeset viewer.