Ignore:
Timestamp:
Sep 7, 2021, 9:59:12 AM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
2bfee8e
Parents:
49b3389
Message:

Some clean-up to make Peter's changes to the exception benchmarks fit in better. And make test.sh a bit more robust.

File:
1 edited

Legend:

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

    r49b3389 r812ba3d  
    33#include <exception.hfa>
    44#include <fstream.hfa>
    5 #include <stdlib.hfa>                                                                   // strto
     5#include <stdlib.hfa>
    66
    77exception fixup_exception {
     
    1313};
    1414
    15 unsigned int frames;                                                                    // use global because of gcc thunk problem
     15// Using a global value to allow hoisting (and avoid thunks).
     16unsigned int frames;
    1617
    1718void nounwind_other(unsigned int dummy) {
     
    2021                try {
    2122                        nounwind_other(42);
    22                         if ( frames == -1 ) printf( "42" );                     // prevent recursion optimizations
     23                        // Always false, but prevents recursion elimination.
     24                        if (-1 == frames) printf("~");
    2325                } catchResume (not_raised_exception * ex) {
    24                         ex->fixup = frames + 42;                                        // use local scope => lexical link
     26                        ex->fixup = frames + 42;
    2527                }
    2628        } else {
    2729                int fixup = dummy;
    28                 throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup
     30                throwResume (fixup_exception){&fixup_vt, fixup};
    2931        }
    3032}
Note: See TracChangeset for help on using the changeset viewer.