Mercurial > hg > CbC > CbC_examples
view tmp2.c @ 25:6324b8df04f1
lj_as2: fix segmentation fault
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Jan 2016 21:44:55 +0900 |
parents | 175041088754 |
children | 586096c45873 |
line wrap: on
line source
#ifdef GCC #define __environment _CbC_environment #define __return _CbC_return #endif #include "stdio.h" int main0(int ac,char *av[]); __code code0(char *av[],__code (*ret)(),void *retenv); __code code1(char *av[],__code (*ret)(),void *retenv); int main(int ac,char *av[]) { int i; i=main0(ac,av); fprintf(stdout,"#0012:1: %s %d\n",av[0],i); return 0; } int main0(int ac,char *av[]) { fprintf(stdout,"#0021:2: %s\n",av[0]); goto code0(av,__return,__environment); return 0; } __code code0(char *av[],__code (*ret)(int,void*),void *retenv) { char *p; p = av[0]; fprintf(stdout,"#0032:3: %s\n",p); goto code1(av,ret,retenv); } __code code1(char *av[],__code (*ret)(int, void*),void *retenv) { fprintf(stdout,"#0041:4: %s\n",av[0]); goto (*ret)(1234,retenv); }