Changes in libcfa/src/exception.c [d119d613:ba70330]
- File:
-
- 1 edited
-
libcfa/src/exception.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.c
rd119d613 rba70330 209 209 void * stop_param) { 210 210 // Verify actions follow the rules we expect. 211 verify(actions & _UA_CLEANUP_PHASE); 212 verify(actions & _UA_FORCE_UNWIND); 213 verify(!(actions & _UA_SEARCH_PHASE)); 214 verify(!(actions & _UA_HANDLER_FRAME)); 211 verify((actions & _UA_CLEANUP_PHASE) && (actions & _UA_FORCE_UNWIND)); 212 verify(!(actions & (_UA_SEARCH_PHASE | _UA_HANDLER_FRAME))); 215 213 216 214 if ( actions & _UA_END_OF_STACK ) { 217 abort();215 exit(1); 218 216 } else { 219 217 return _URC_NO_REASON; … … 221 219 } 222 220 223 __attribute__((weak)) _Unwind_Reason_Code 224 __cfaehm_cancellation_unwind( struct _Unwind_Exception * exception ) { 225 return _Unwind_ForcedUnwind( exception, _Stop_Fn, (void*)0x22 ); 226 } 221 static struct _Unwind_Exception cancel_exception_storage; 227 222 228 223 // Cancel the current stack, prefroming approprate clean-up and messaging. 229 224 void __cfaehm_cancel_stack( exception_t * exception ) { 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 225 // TODO: Detect current stack and pick a particular stop-function. 244 226 _Unwind_Reason_Code ret; 245 ret = _ _cfaehm_cancellation_unwind( &node->unwind_exception);227 ret = _Unwind_ForcedUnwind( &cancel_exception_storage, _Stop_Fn, (void*)0x22 ); 246 228 printf("UNWIND ERROR %d after force unwind\n", ret); 247 229 abort();
Note:
See TracChangeset
for help on using the changeset viewer.