Ignore:
Timestamp:
Sep 7, 2021, 12:26:06 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
031453c
Parents:
1341ce1 (diff), 812ba3d (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r1341ce1 r2bfee8e  
    22#include <clock.hfa>
    33#include <fstream.hfa>
    4 #include <stdlib.hfa>                                                                   // strto
     4#include <stdlib.hfa>
    55
    6 int nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) {
     6void nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) {
    77        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                // "Always" false, but prevents recursion elimination.
     10                if (-1 == frames) printf("~");
    1211        } else {
    1312                int fixup = 17;
    1413                raised_rtn(fixup);
    15                 return fixup;
    1614        }
    1715}
     
    2725        }
    2826
     27        // Closures at the top level are allowed to be true closures.
    2928        void raised(int & fixup) {
    30                 fixup = total_frames + 42;                                              // use local scope => lexical link
    31                 if ( total_frames == 42 ) printf( "42" );
     29                fixup = total_frames + 42;
     30                if (total_frames == 42) printf("42");
    3231        }
    3332
Note: See TracChangeset for help on using the changeset viewer.