Changeset d322f62


Ignore:
Timestamp:
Aug 31, 2021, 1:49:10 AM (3 years ago)
Author:
Jacob Prud'homme <jafprudhomme@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
Children:
f62e741
Parents:
57dff2f
git-author:
Jacob Prud'homme <jafprudhomme@…> (08/06/21 00:56:45)
git-committer:
Jacob Prud'homme <jafprudhomme@…> (08/31/21 01:49:10)
Message:

Used more modern built-in EHM

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseconfig.cfa

    r57dff2f rd322f62  
    99
    1010
    11 EHM_VIRTUAL_TABLE(Validation_Failure, Validation_Failure_main_table);
     11static vtable(Validation_Failure) Validation_Failure_vt;
     12
    1213void ?{}( Validation_Failure & this, config_entry & entry ) with ( entry ) {
    13         this.virtual_table = &Validation_Failure_main_table;
     14        this.virtual_table = &Validation_Failure_vt;
    1415        this.key = key;
    1516        this.variable = variable;
    16 }
    17 void throwValidation_Failure( config_entry & entry ) {
    18         Validation_Failure exc = { entry };
    1917}
    2018
     
    122120                                // Validate the parsed data, if necessary
    123121                                if ( entries[j].validate != (bool (*)(void *))0p ) {
    124                                         if ( !entries[j].validate( entries[j].variable ) ) throwValidation_Failure( entries[j] );
     122                                        if ( !entries[j].validate( entries[j].variable ) ) throw (Validation_Failure){ entries[j] }; // HERE (segfaults on throw)
    125123                                }
    126124
  • libcfa/src/parseconfig.hfa

    r57dff2f rd322f62  
    5656
    5757
    58 EHM_EXCEPTION(Validation_Failure)(
     58exception Validation_Failure {
    5959        const char * key;
    6060        void * variable;
    61 );
     61};
    6262
    6363void ?{}( Validation_Failure & this, config_entry & entry );
Note: See TracChangeset for help on using the changeset viewer.