Changeset 18783b4 for doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa
- Timestamp:
- Sep 4, 2021, 10:34:43 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 49b3389
- Parents:
- f450f2f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa
rf450f2f r18783b4 4 4 #include <stdlib.hfa> // strto 5 5 6 intnounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) {6 void nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) { 7 7 if (frames) { 8 int rtn = nounwind_fixup(frames - 1, raised_rtn); 9 if ( rtn == 42 ) printf( "42" ); // make non-tail recursive 10 return rtn; 11 8 nounwind_fixup(frames - 1, raised_rtn); 9 if ( frames == -1 ) printf( "42" ); // prevent recursion optimizations 12 10 } else { 13 11 int fixup = 17; 14 12 raised_rtn(fixup); 15 return fixup;16 13 } 17 14 }
Note: See TracChangeset
for help on using the changeset viewer.