summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-11-07 03:54:22 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-11-07 03:54:22 +0900
commite92d4e2680716d3e16a264e46394cb6e458699f9 (patch)
tree4b0a9bb35ba4e75126436ce71ad5ece67b7193cd /src/state.c
parentf80401de6c9b7dd9e0676c4414aae7a6e033ac5f (diff)
downloadmruby-e92d4e2680716d3e16a264e46394cb6e458699f9.tar.gz
mruby-e92d4e2680716d3e16a264e46394cb6e458699f9.zip
modified to use irep->reps to reference child ireps. preparation for
removing irep array from mrb_state. note that instructions OP_LAMBDA, OP_EXEC and OP_EPUSH are incompatible, and dumped mrb format has changed.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index 59cb51b08..1ea76a107 100644
--- a/src/state.c
+++ b/src/state.c
@@ -107,7 +107,7 @@ void mrb_free_symtbl(mrb_state *mrb);
void mrb_free_heap(mrb_state *mrb);
void
-mrb_irep_free(mrb_state *mrb, struct mrb_irep *irep)
+mrb_irep_free(mrb_state *mrb, mrb_irep *irep)
{
if (!(irep->flags & MRB_ISEQ_NO_FREE))
mrb_free(mrb, irep->iseq);
@@ -180,8 +180,7 @@ mrb_add_irep(mrb_state *mrb)
}
irep = (mrb_irep *)mrb_malloc(mrb, sizeof(mrb_irep));
*irep = mrb_irep_zero;
- mrb->irep[mrb->irep_len] = irep;
- irep->idx = mrb->irep_len++;
+ mrb->irep[mrb->irep_len++] = irep;
return irep;
}