Ignore:
Timestamp:
Apr 2, 2020, 3:00:55 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
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
Message:

Fixed the disabled exceptions/resume test. Added more tests in exceptions/interact, one of which is disabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r6d43cdde r3eb5a478  
    1010// Created On       : Mon Jun 26 15:13:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Mar 27 10:19:00 2020
    13 // Update Count     : 12
     12// Last Modified On : Thr Apr 02 14:47:00 2020
     13// Update Count     : 13
    1414//
    1515
     
    5353// Temperary global exception context. Does not work with concurency.
    5454struct 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};
    6160
    6261// Get the current exception context.
     
    7574        __cfaabi_dbg_print_safe("Throwing resumption exception\n");
    7675
    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;
    8078
    8179        for ( ; current ; current = current->next) {
    82                 context->current_resume = current;
     80                context->top_resume = current->next;
    8381                if (current->handler(except)) {
    84                         context->current_resume = original_head;
     82                        context->top_resume = original_head;
    8583                        return;
    8684                }
     
    8886
    8987        __cfaabi_dbg_print_safe("Unhandled exception\n");
    90         context->current_resume = original_head;
     88        context->top_resume = original_head;
    9189
    9290        // Fall back to termination:
Note: See TracChangeset for help on using the changeset viewer.