summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gc.c2
-rw-r--r--src/proc.c2
-rw-r--r--src/vm.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/gc.c b/src/gc.c
index 81b234d6f..426a84514 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -518,7 +518,7 @@ gc_mark_children(mrb_state *mrb, struct RBasic *obj)
if (e->cioff < 0) {
int i, len;
- len = (int)e->flags;
+ len = (int)MRB_ENV_STACK_LEN(e);
for (i=0; i<len; i++) {
mrb_gc_mark_value(mrb, e->stack[i]);
}
diff --git a/src/proc.c b/src/proc.c
index 4e6e2b95f..0dfc3f818 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -41,7 +41,7 @@ closure_setup(mrb_state *mrb, struct RProc *p, int nlocals)
if (!mrb->c->ci->env) {
e = (struct REnv*)mrb_obj_alloc(mrb, MRB_TT_ENV, (struct RClass*)mrb->c->ci->proc->env);
- e->flags= (unsigned int)nlocals;
+ MRB_ENV_STACK_LEN(e)= (unsigned int)nlocals;
e->mid = mrb->c->ci->mid;
e->cioff = mrb->c->ci - mrb->c->cibase;
e->stack = mrb->c->stack;
diff --git a/src/vm.c b/src/vm.c
index ad26d9b8c..e2b02a4ce 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -245,7 +245,7 @@ cipop(mrb_state *mrb)
if (c->ci->env) {
struct REnv *e = c->ci->env;
- size_t len = (size_t)e->flags;
+ size_t len = (size_t)MRB_ENV_STACK_LEN(e);
mrb_value *p = (mrb_value *)mrb_malloc(mrb, sizeof(mrb_value)*len);
e->cioff = -1;