# HG changeset patch # User Shinji KONO # Date 1541653916 -32400 # Node ID 4627f235cf2a9e075ebc83fc7ba6a2f54794d85a # Parent 71d4882a9ac3a3462c43d976004c0a4a17d7a101 fix c-next example diff -r 71d4882a9ac3 -r 4627f235cf2a CbC-examples/Makefile --- a/CbC-examples/Makefile Thu Nov 08 06:52:59 2018 +0900 +++ b/CbC-examples/Makefile Thu Nov 08 14:11:56 2018 +0900 @@ -1,4 +1,4 @@ -TEST = arg.exe conv1.exe fact-a.exe goto.exe loto6.exe stack1.exe test02.exe test05.exe test1.exe test2.exe test_cs.exe test_csp1.exe test_func2code.exe test_para2.exe test_para3.exe test_para4.exe test_para.exe test_tree.exe tmp1.exe tmp2.exe tmp4.exe tmpa.exe too-long-argument.exe +TEST = arg.exe conv1.exe fact-a.exe goto.exe loto6.exe stack1.exe test02.exe test05.exe test1.exe test2.exe test_cs.exe test_csp1.exe test_func2code.exe test_para2.exe test_para3.exe test_para4.exe test_para.exe test_tree.exe tmp1.exe tmp2.exe tmp4.exe tmpa.exe too-long-argument.exe c-next.exe .SUFFIXES: .exe diff -r 71d4882a9ac3 -r 4627f235cf2a CbC-examples/c-next.c --- a/CbC-examples/c-next.c Thu Nov 08 06:52:59 2018 +0900 +++ b/CbC-examples/c-next.c Thu Nov 08 14:11:56 2018 +0900 @@ -5,7 +5,6 @@ typedef long* MVMRegister; typedef void* MVMCompUnit; typedef void* MVMCallsite; -typedef void* MVMThreadContext; typedef struct MVMThreadContext { MVMuint8 **interp_cur_op; @@ -41,6 +40,8 @@ } INTER,*INTERP; +__code cbc_next(INTERP i); + __code cbc_no_op(INTERP i){ goto cbc_next(i); } @@ -62,16 +63,20 @@ } int interp_run(MVMThreadContext *tc){ + return 0; } int main(int argc, char **argv){ INTER inter = {0,0,0,0,0,0,0,0,0}; INTERP i = &inter; - MVMuint8 cur_ops = {0,1,2,0,3,2}; + MVMuint8 cur_ops[] = {0,1,2,0,3,2}; i->main_ret = _CbC_return; i->env = _CbC_environment; - i->cur_op = &cur_ops; + i->cur_op = cur_ops; + + MVMThreadContext tc0, *tc; + tc = &tc0; tc->interp_cur_op = &i->cur_op; tc->interp_bytecode_start = &i->bytecode_start;