From f090eae2416c6d0bab1e5bbd751da723236ffaf6 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 4 Feb 2014 10:40:16 +0900 Subject: [PATCH] restore ip when returned from c function --- src/vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vm.c b/src/vm.c index 302a8bcb..e61c62ff 100644 --- a/src/vm.c +++ b/src/vm.c @@ -582,8 +582,9 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) ci->env = NULL; if (pic_proc_cfunc_p(x)) { v = proc->u.cfunc(pic); + ci = POPCI(); + pic->ip = ci->pc; pic->sp = ci->fp; - POPCI(); PUSH(v); pic_gc_arena_restore(pic, ai); NEXT;