ADT
        arm-eh
        ast-experimental
        enum
        forall-pointer-decay
        jacob/cs343-translation
        new-ast-unique-expr
        pthread-emulation
        qualifiedEnum
      
      
        
          | Last change
 on this file since 84cd72d was             ecfd758, checked in by Andrew Beach <ajbeach@…>, 5 years ago | 
        
          | 
Major exception update, seperating type-ids from virtual tables. The major interface changes are done. There is a regression of ?Cancelled(T) to Some?Cancelled. There is some bits of code for the new verion of the ?Cancelled(T) interface already there. Not connected yet but I just reached the limit of what I wanted to do in one commit and then spent over a day cleaning up, so it will replace Some?Cancelled in a future commit.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            538 bytes | 
      
      
| Rev | Line |  | 
|---|
| [980fb4e] | 1 | // Make sure throw-catch during unwind does not trash internal data. | 
|---|
|  | 2 |  | 
|---|
|  | 3 | #include <exception.hfa> | 
|---|
|  | 4 |  | 
|---|
| [ecfd758] | 5 | EHM_EXCEPTION(yin)(); | 
|---|
|  | 6 | EHM_EXCEPTION(yang)(); | 
|---|
|  | 7 |  | 
|---|
|  | 8 | EHM_VIRTUAL_TABLE(yin, yin_vt); | 
|---|
|  | 9 | EHM_VIRTUAL_TABLE(yang, yang_vt); | 
|---|
| [980fb4e] | 10 |  | 
|---|
|  | 11 | int main(int argc, char * argv[]) { | 
|---|
|  | 12 | try { | 
|---|
|  | 13 | try { | 
|---|
| [ecfd758] | 14 | throw (yin){&yin_vt}; | 
|---|
| [980fb4e] | 15 | } finally { | 
|---|
|  | 16 | try { | 
|---|
| [ecfd758] | 17 | throw (yang){&yang_vt}; | 
|---|
| [980fb4e] | 18 | } catch (yin *) { | 
|---|
|  | 19 | printf("inner yin\n"); | 
|---|
|  | 20 | } catch (yang *) { | 
|---|
|  | 21 | printf("inner yang\n"); | 
|---|
|  | 22 | } | 
|---|
|  | 23 | } | 
|---|
|  | 24 | } catch (yin *) { | 
|---|
|  | 25 | printf("outer yin\n"); | 
|---|
|  | 26 | } catch (yang *) { | 
|---|
|  | 27 | printf("outer yang\n"); | 
|---|
|  | 28 | } | 
|---|
|  | 29 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.