inti env->value with undef objects
This commit is contained in:
parent
392eb61e51
commit
2732a5a4ec
4
src/vm.c
4
src/vm.c
|
@ -278,10 +278,14 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args)
|
||||||
CASE(OP_LAMBDA) {
|
CASE(OP_LAMBDA) {
|
||||||
struct pic_proc *proc;
|
struct pic_proc *proc;
|
||||||
struct pic_env *env;
|
struct pic_env *env;
|
||||||
|
int i;
|
||||||
|
|
||||||
env = (struct pic_env *)pic_obj_alloc(pic, sizeof(struct pic_env), PIC_TT_ENV);
|
env = (struct pic_env *)pic_obj_alloc(pic, sizeof(struct pic_env), PIC_TT_ENV);
|
||||||
env->num_val = pic->irep[pc->u.i]->argc;
|
env->num_val = pic->irep[pc->u.i]->argc;
|
||||||
env->values = (pic_value *)pic_alloc(pic, sizeof(pic_value) * env->num_val);
|
env->values = (pic_value *)pic_alloc(pic, sizeof(pic_value) * env->num_val);
|
||||||
|
for (i = 0; i < env->num_val; ++i) {
|
||||||
|
env->values[i] = pic_undef_value();
|
||||||
|
}
|
||||||
env->up = pic_proc_ptr(*pic->ci->fp)->env;
|
env->up = pic_proc_ptr(*pic->ci->fp)->env;
|
||||||
|
|
||||||
proc = pic_proc_new(pic, pic->irep[pc->u.i], env);
|
proc = pic_proc_new(pic, pic->irep[pc->u.i], env);
|
||||||
|
|
Loading…
Reference in New Issue