warn invalid application
This commit is contained in:
parent
d75b624b4a
commit
a926c54be3
|
@ -19,6 +19,8 @@ struct pic_proc {
|
||||||
pic_value aux;
|
pic_value aux;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define pic_proc_p(o) (pic_type(o) == PIC_TT_PROC)
|
||||||
|
|
||||||
#define pic_proc_ptr(o) ((struct pic_proc *)(o).u.data)
|
#define pic_proc_ptr(o) ((struct pic_proc *)(o).u.data)
|
||||||
|
|
||||||
#define pic_proc_cfunc_p(o) (pic_proc_ptr(o)->cfunc_p)
|
#define pic_proc_cfunc_p(o) (pic_proc_ptr(o)->cfunc_p)
|
||||||
|
|
4
src/vm.c
4
src/vm.c
|
@ -224,6 +224,10 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args)
|
||||||
struct pic_proc *proc;
|
struct pic_proc *proc;
|
||||||
|
|
||||||
c = pic->sp[-pc->u.i];
|
c = pic->sp[-pc->u.i];
|
||||||
|
if (! pic_proc_p(c)) {
|
||||||
|
pic->errmsg = "invalid application";
|
||||||
|
goto L_RAISE;
|
||||||
|
}
|
||||||
proc = pic_proc_ptr(c);
|
proc = pic_proc_ptr(c);
|
||||||
|
|
||||||
ci = PUSHCI();
|
ci = PUSHCI();
|
||||||
|
|
Loading…
Reference in New Issue