view test/tmp4.c @ 417:98888da30b35

code jump fixes (not finished)
author kono
date Mon, 25 Oct 2004 01:16:28 +0900
parents f00e3bfa1b45
children 682c8ec38d45
line wrap: on
line source

#include "stdio.h"

int
main(ac,av)
int ac;
char *av[];
{
    int i;
    i=main0(ac,av);
    fprintf(stdout,"1: %s %d\n",av[0]+2,i);
    return 0;
}

int
main0(ac,av)
int ac;
char *av[];
{
    int i,j,k;
    i=123;
    j=456;
    k=789;
    fprintf(stdout,"2: %s\n",av[0]+2);
    goto code0(i,j,k,av,return,environment);
}

code code0(i,j,k,av,ret,retenv)
int i,j,k;
char *av[];
code (*ret)();
void *retenv;
{
    char *p;
    p = av[0]+2;
    fprintf(stdout,"3: i=%d j=%d k=%d av[0]=%s p=%s\n",i,j,k,av[0]+2,p);
    goto code1(i,j,k,av,ret,retenv);
}

code code1(i,j,k,av,ret,retenv)
int i,j,k;
char *av[];
code (*ret)();
void *retenv;
{
    fprintf(stdout,"4: %s\n",av[0]+2);
    goto code2(i,j,k,av,ret,retenv);
}

code code2(i,j,k,av,ret,retenv)
int i,j,k;
char *av[];
code (*ret)();
void *retenv;
{
    fprintf(stdout,"5: %s\n",av[0]+2);
    fprintf(stdout,"5: i=%d j=%d k=%d\n",i,j,k);
    goto (*ret)(1234),retenv;
}