refactor the last change
This commit is contained in:
parent
8039ddf9c5
commit
b2e1c523bc
12
src/vm.c
12
src/vm.c
|
@ -775,11 +775,10 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
|
|||
ci->fp = pic->sp - c.u.i;
|
||||
ci->env = NULL;
|
||||
if (pic_proc_func_p(pic_proc_ptr(x))) {
|
||||
pic_value *sp;
|
||||
|
||||
/* invoke! */
|
||||
sp = pic->sp;
|
||||
sp[0] = proc->u.func.f(pic);
|
||||
v = proc->u.func.f(pic);
|
||||
pic->sp[0] = v;
|
||||
pic->sp += pic->ci->retc;
|
||||
|
||||
pic_gc_arena_restore(pic, ai);
|
||||
|
@ -1046,5 +1045,10 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
|
|||
ci->ip = (pic_code *)&iseq - 1;
|
||||
ci->fp = pic->sp;
|
||||
ci->retc = pic_length(pic, args);
|
||||
return pic_obj_value(proc);
|
||||
|
||||
if (ci->retc == 0) {
|
||||
return pic_none_value();
|
||||
} else {
|
||||
return pic_car(pic, args);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue