diff CbC-examples/c-next.c @ 136:4627f235cf2a

fix c-next example
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:11:56 +0900
parents 71d4882a9ac3
children d22083d7f10b
line wrap: on
line diff
--- 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;