Ignore:
Timestamp:
Jan 11, 2019, 3:15:51 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
276a55b2, 690166d, 95b8aa7
Parents:
d97c3a4 (diff), 7bd3bf2 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/invoke.c

    rd97c3a4 r52ffa30  
    1717#include <stdlib.h>
    1818#include <stdio.h>
     19#include <unwind.h>
    1920
    2021#include "invoke.h"
     
    5051        main( this );
    5152
    52         cor->state = Halted;
    53 
    5453        //Final suspend, should never return
    5554        __leave_coroutine();
    5655        __cabi_abort( "Resumed dead coroutine" );
     56}
     57
     58static _Unwind_Reason_Code _CtxCoroutine_UnwindStop(
     59        __attribute((__unused__)) int version,
     60        _Unwind_Action actions,
     61        __attribute((__unused__)) _Unwind_Exception_Class exceptionClass,
     62        __attribute((__unused__)) struct _Unwind_Exception * unwind_exception,
     63        __attribute((__unused__)) struct _Unwind_Context * context,
     64        __attribute((__unused__)) void * param
     65) {
     66        if( actions & _UA_END_OF_STACK  ) {
     67                // We finished unwinding the coroutine,
     68                // leave it
     69                __leave_coroutine();
     70                __cabi_abort( "Resumed dead coroutine" );
     71        }
     72        if( actions & _UA_CLEANUP_PHASE ) return _URC_NO_REASON;
     73
     74        return _URC_FATAL_PHASE2_ERROR;
     75}
     76
     77void _CtxCoroutine_Unwind(struct _Unwind_Exception * storage) __attribute__ ((__noreturn__));
     78void _CtxCoroutine_Unwind(struct _Unwind_Exception * storage) {
     79        _Unwind_Reason_Code ret = _Unwind_ForcedUnwind( storage, _CtxCoroutine_UnwindStop, NULL );
     80        printf("UNWIND ERROR %d after force unwind\n", ret);
     81        abort();
    5782}
    5883
Note: See TracChangeset for help on using the changeset viewer.