From bad8daa8134aa6d1e22e965119db27747b62fa68 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 20 Feb 2014 17:19:28 +0900 Subject: [PATCH] ci->retc is set to 1 by default --- src/vm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vm.c b/src/vm.c index b3d63756..48823f23 100644 --- a/src/vm.c +++ b/src/vm.c @@ -565,7 +565,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) ci = PUSHCI(); ci->argc = c.u.i; - ci->retc = -1; + ci->retc = 1; ci->ip = pic->ip; ci->fp = pic->sp - c.u.i; ci->env = NULL; @@ -573,9 +573,8 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) /* invoke! */ v = proc->u.cfunc(pic); - if (ci->retc == -1) { + if (ci->retc == 1 && pic->sp == ci->fp + c.u.i) { PUSH(v); - ci->retc = 1; } pic_gc_arena_restore(pic, ai);