restore ip when returned from c function
This commit is contained in:
parent
018db310d3
commit
f090eae241
3
src/vm.c
3
src/vm.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue