[bugfix] handle 1-coarity native function

This commit is contained in:
Yuichi Nishiwaki 2014-02-20 16:50:14 +09:00
parent 7217baee0a
commit 82647584e8
1 changed files with 6 additions and 2 deletions

View File

@ -566,7 +566,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;
@ -575,7 +575,11 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
pic_value *retv;
/* invoke! */
PUSH(proc->u.cfunc(pic));
v = proc->u.cfunc(pic);
if (ci->retc == -1) {
PUSH(v);
ci->retc = 1;
}
retc = ci->retc;
retv = pic->sp - retc;