Changeset 812ba3d for doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa
- Timestamp:
- Sep 7, 2021, 9:59:12 AM (19 months ago)
- Branches:
- enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 2bfee8e
- Parents:
- 49b3389
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa
r49b3389 r812ba3d 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 { … … 13 13 }; 14 14 15 unsigned int frames; // use global because of gcc thunk problem 15 // Using a global value to allow hoisting (and avoid thunks). 16 unsigned int frames; 16 17 17 18 void nounwind_other(unsigned int dummy) { … … 20 21 try { 21 22 nounwind_other(42); 22 if ( frames == -1 ) printf( "42" ); // prevent recursion optimizations 23 // Always false, but prevents recursion elimination. 24 if (-1 == frames) printf("~"); 23 25 } catchResume (not_raised_exception * ex) { 24 ex->fixup = frames + 42; // use local scope => lexical link26 ex->fixup = frames + 42; 25 27 } 26 28 } else { 27 29 int fixup = dummy; 28 throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup30 throwResume (fixup_exception){&fixup_vt, fixup}; 29 31 } 30 32 }
Note: See TracChangeset
for help on using the changeset viewer.