Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    rcb20dcd rf1b6671  
    1010// Created On       : Mon Jun 26 15:13:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Apr  9 12:20:00 2020
    13 // Update Count     : 17
     12// Last Modified On : Mon Apr 06 14:40:00 2020
     13// Update Count     : 15
    1414//
    1515
     
    2828#include <unwind.h>
    2929#include <bits/debug.hfa>
    30 #include "stdhdr/assert.h"
    3130
    3231// FIX ME: temporary hack to keep ARM build working
     
    217216                struct _Unwind_Context * unwind_context,
    218217                void * stop_param) {
    219         // Verify actions follow the rules we expect.
    220         verify((actions & _UA_CLEANUP_PHASE) && actions & (_UA_FORCE_UNWIND));
    221         verify(!(actions & (_UA_SEARCH_PHASE | _UA_HANDER_FRAME)));
    222 
    223         if ( actions & _UA_END_OF_STACK ) {
    224                 exit(1);
    225         } else {
    226                 return _URC_NO_REASON;
    227         }
     218        if ( actions & _UA_END_OF_STACK  ) exit(1);
     219        if ( actions & _UA_CLEANUP_PHASE ) return _URC_NO_REASON;
     220
     221        return _URC_FATAL_PHASE2_ERROR;
    228222}
    229223
     
    288282                        version, actions, exception_class, unwind_exception, unwind_context);
    289283
    290         // Verify that actions follow the rules we expect.
    291         // This function should never be called at the end of the stack.
    292         verify(!(actions & _UA_END_OF_STACK));
    293         // Either only the search phase flag is set or...
     284        // If we've reached the end of the stack then there is nothing much we can do...
     285        if (actions & _UA_END_OF_STACK) return _URC_END_OF_STACK;
     286
    294287        if (actions & _UA_SEARCH_PHASE) {
    295                 verify(actions == _UA_SEARCH_PHASE);
    296288                __cfaabi_dbg_print_safe(" lookup phase");
    297         // ... we are in clean-up phase.
    298         } else {
    299                 verify(actions & _UA_CLEANUP_PHASE);
     289        }
     290        else if (actions & _UA_CLEANUP_PHASE) {
    300291                __cfaabi_dbg_print_safe(" cleanup phase");
    301                 // We shouldn't be the handler frame during forced unwind.
    302                 if (actions & _UA_HANDLER_FRAME) {
    303                         verify(!(actions & _UA_FORCE_UNWIND));
    304                         __cfaabi_dbg_print_safe(" (handler frame)");
    305                 } else if (actions & _UA_FORCE_UNWIND) {
    306                         __cfaabi_dbg_print_safe(" (force unwind)");
    307                 }
     292        }
     293        // Just in case, probably can't actually happen
     294        else {
     295                printf(" error\n");
     296                return _URC_FATAL_PHASE1_ERROR;
    308297        }
    309298
     
    407396                        // This is only a cleanup handler, ignore it
    408397                        __cfaabi_dbg_print_safe(" no action");
    409                 } else {
     398                } else if (actions & _UA_CLEANUP_PHASE) {
    410399                        // In clean-up phase, no destructors here but this could be the handler.
    411400
     
    445434
    446435#pragma GCC push_options
    447 #pragma GCC optimize("no-toplevel-reorder")
     436#pragma GCC optimize("O0")
    448437
    449438// Try statements are hoisted out see comments for details. While this could probably be unique
Note: See TracChangeset for help on using the changeset viewer.