From a90e124697766684fcdf1ed74cfd06e2c4f1732e Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 16 Oct 2013 09:28:58 +0900 Subject: [PATCH] change ways of taking care of CI --- src/vm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vm.c b/src/vm.c index 36221164..9ff1b350 100644 --- a/src/vm.c +++ b/src/vm.c @@ -317,8 +317,8 @@ pic_codegen(pic_state *pic, pic_value obj, struct pic_env *env) #define PUSH(v) (*pic->sp++ = (v)) #define POP() (*--pic->sp) -#define PUSHCI() (++pic->ci) -#define POPCI() (pic->ci--) +#define PUSHCI() (pic->ci++) +#define POPCI() (--pic->ci) pic_value pic_run(pic_state *pic, struct pic_proc *proc, pic_value args) @@ -327,6 +327,8 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args) int ai = pic_gc_arena_preserve(pic); pc = proc->u.irep->code; + + PUSHCI(); pic->ci->proc = proc; pic->ci->argc = 0; @@ -409,6 +411,7 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args) } VM_LOOP_END; STOP: + POPCI(); return POP(); }