summaryrefslogtreecommitdiffhomepage
path: root/src/vm.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/vm.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/vm.c')
-rw-r--r--src/vm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vm.c b/src/vm.c
index d35ab59f2..be3518e8d 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -830,7 +830,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
/* Bx ensure_push(SEQ[Bx]) */
struct RProc *p;
- p = mrb_closure_new(mrb, mrb->irep[irep->idx+GETARG_Bx(i)]);
+ p = mrb_closure_new(mrb, irep->reps[GETARG_Bx(i)]);
/* push ensure_stack */
if (mrb->c->esize <= mrb->c->ci->eidx) {
if (mrb->c->esize == 0) mrb->c->esize = 16;
@@ -1967,10 +1967,10 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
int c = GETARG_c(i);
if (c & OP_L_CAPTURE) {
- p = mrb_closure_new(mrb, mrb->irep[irep->idx+GETARG_b(i)]);
+ p = mrb_closure_new(mrb, irep->reps[GETARG_b(i)]);
}
else {
- p = mrb_proc_new(mrb, mrb->irep[irep->idx+GETARG_b(i)]);
+ p = mrb_proc_new(mrb, irep->reps[GETARG_b(i)]);
}
if (c & OP_L_STRICT) p->flags |= MRB_PROC_STRICT;
regs[GETARG_A(i)] = mrb_obj_value(p);
@@ -2038,7 +2038,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
/* prepare stack */
mrb->c->stack += a;
- p = mrb_proc_new(mrb, mrb->irep[irep->idx+GETARG_Bx(i)]);
+ p = mrb_proc_new(mrb, irep->reps[GETARG_Bx(i)]);
p->target_class = ci->target_class;
ci->proc = p;