Changeset e68d092 for tests/exceptions/conditional.cfa
- Timestamp:
- May 7, 2020, 11:25:15 AM (3 years ago)
- Branches:
- arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8e16177, af7acb9
- Parents:
- d6566c1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/conditional.cfa
rd6566c1 re68d092 4 4 // up the non-trivial exception is reasonable to do. 5 5 6 #include "except-mac.hfa"6 #include <exception.hfa> 7 7 #include <stdio.h> 8 8 9 DECLARE_EXCEPT(num_error, BASE_EXCEPT, 9 VTABLE_DECLARATION(num_error)( 10 10 int (*code)(num_error *this); 11 11 ); … … 36 36 this.num = other.num; 37 37 } 38 void copy(num_error * this, num_error * other) {39 *this = *other;40 }41 38 void ^?{}(num_error & this) { 42 39 if( this.msg ) free( this.msg ); … … 46 43 } 47 44 48 VTABLE_INSTANCE(num_error, BASE_EXCEPT, copy, ^?{}, 49 num_error_msg, num_error_code 45 VTABLE_INSTANCE(num_error)( 46 num_error_msg, 47 num_error_code, 50 48 ); 51 49 … … 58 56 59 57 try { 60 THROW(&exc);58 throw &exc; 61 59 } catch (num_error * error ; 3 == error->virtual_table->code( error )) { 62 60 caught_num_error(3, error); … … 66 64 67 65 try { 68 THROW_RESUME(&exc);66 throwResume &exc; 69 67 } catchResume (num_error * error ; 3 == error->virtual_table->code( error )) { 70 68 caught_num_error(3, error);
Note: See TracChangeset
for help on using the changeset viewer.