restore ip when returned from c function

This commit is contained in:
Yuichi Nishiwaki 2014-02-04 10:40:16 +09:00
parent 018db310d3
commit f090eae241
1 changed files with 2 additions and 1 deletions

View File

@ -582,8 +582,9 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
ci->env = NULL; ci->env = NULL;
if (pic_proc_cfunc_p(x)) { if (pic_proc_cfunc_p(x)) {
v = proc->u.cfunc(pic); v = proc->u.cfunc(pic);
ci = POPCI();
pic->ip = ci->pc;
pic->sp = ci->fp; pic->sp = ci->fp;
POPCI();
PUSH(v); PUSH(v);
pic_gc_arena_restore(pic, ai); pic_gc_arena_restore(pic, ai);
NEXT; NEXT;