Ignore:
Timestamp:
Sep 4, 2021, 10:34:43 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
49b3389
Parents:
f450f2f
Message:

attempt to remove tail-recursion optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa

    rf450f2f r18783b4  
    1010vtable(fixup_exception) fixup_vt;
    1111
    12 int nounwind_empty(unsigned int frames) {
     12void nounwind_empty(unsigned int frames) {
    1313        if (frames) {
    14                 int rtn = nounwind_empty(frames - 1);
    15                 if ( rtn == 42 ) printf( "42" );                                // make non-tail recursive
    16                 return rtn;
     14                nounwind_empty(frames - 1);
     15                if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations
    1716        } else {
    1817                int fixup = 17;
    1918                throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup
    20                 return fixup;
    2119        }
    2220}
Note: See TracChangeset for help on using the changeset viewer.