view CbC-examples/test02.c @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 5d30d517ebed
children
line wrap: on
line source

#include<stdio.h>
extern int printf(const char*, ...);

__code test_code(void){
	printf("\t\ttest_code: return 10\n");
	return;
}

__code test_goto(int a){
	printf("\ttest_goto: a = %d\n", a);
	//return test_code();
	goto test_code();
}

int main(int argc, char **argv){
	int ret=0;
	printf("test code\n");
	test_goto(20);
	printf("main: ret = %d\n", ret);

	return 0;
}