s/num_val/valuec/g
This commit is contained in:
parent
c24560de12
commit
d0602303e3
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
struct pic_code;
|
struct pic_code;
|
||||||
|
|
||||||
typedef struct pic_callinfo {
|
typedef struct {
|
||||||
int argc;
|
int argc;
|
||||||
struct pic_code *pc;
|
struct pic_code *pc;
|
||||||
pic_value *fp;
|
pic_value *fp;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
struct pic_env {
|
struct pic_env {
|
||||||
PIC_OBJECT_HEADER
|
PIC_OBJECT_HEADER
|
||||||
pic_value *values;
|
pic_value *values;
|
||||||
int num_val;
|
int valuec;
|
||||||
struct pic_env *up;
|
struct pic_env *up;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
2
src/gc.c
2
src/gc.c
|
@ -159,7 +159,7 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
struct pic_env *env = (struct pic_env *)obj;
|
struct pic_env *env = (struct pic_env *)obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < env->num_val; ++i) {
|
for (i = 0; i < env->valuec; ++i) {
|
||||||
gc_mark(pic, env->values[i]);
|
gc_mark(pic, env->values[i]);
|
||||||
}
|
}
|
||||||
if (env->up) {
|
if (env->up) {
|
||||||
|
|
6
src/vm.c
6
src/vm.c
|
@ -370,9 +370,9 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
|
||||||
/* prepare env */
|
/* prepare env */
|
||||||
ci->env = (struct pic_env *)pic_obj_alloc(pic, sizeof(struct pic_env), PIC_TT_ENV);
|
ci->env = (struct pic_env *)pic_obj_alloc(pic, sizeof(struct pic_env), PIC_TT_ENV);
|
||||||
ci->env->up = proc->env;
|
ci->env->up = proc->env;
|
||||||
ci->env->num_val = proc->u.irep->argc + proc->u.irep->localc;
|
ci->env->valuec = proc->u.irep->argc + proc->u.irep->localc;
|
||||||
ci->env->values = (pic_value *)pic_calloc(pic, ci->env->num_val, sizeof(pic_value));
|
ci->env->values = (pic_value *)pic_calloc(pic, ci->env->valuec, sizeof(pic_value));
|
||||||
for (i = 0; i < ci->env->num_val; ++i) {
|
for (i = 0; i < ci->env->valuec; ++i) {
|
||||||
ci->env->values[i] = ci->fp[i];
|
ci->env->values[i] = ci->fp[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue