Changeset 949339b for doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa
- Timestamp:
- Sep 27, 2021, 2:09:55 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- cc287800
- Parents:
- 4e28d2e9 (diff), 056cbdb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa
r4e28d2e9 r949339b 3 3 #include <exception.hfa> 4 4 #include <fstream.hfa> 5 #include <stdlib.hfa> // strto5 #include <stdlib.hfa> 6 6 7 7 exception fixup_exception { … … 10 10 vtable(fixup_exception) fixup_vt; 11 11 12 intnounwind_empty(unsigned int frames) {12 void nounwind_empty(unsigned int frames) { 13 13 if (frames) { 14 int rtn =nounwind_empty(frames - 1);15 if ( rtn == 42 ) printf( "42" ); // make non-tail recursive16 return rtn;14 nounwind_empty(frames - 1); 15 // "Always" false, but prevents recursion elimination. 16 if (-1 == frames) printf("~"); 17 17 } else { 18 18 int fixup = 17; 19 throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup 20 return fixup; 19 throwResume (fixup_exception){&fixup_vt, fixup}; 21 20 } 22 21 }
Note:
See TracChangeset
for help on using the changeset viewer.