Permalink
Browse files

`ci` may be moved during `mrb_convert_type()`; ref #3474

  • Loading branch information...
matz committed Mar 1, 2017
1 parent 8b089c0 commit eca35df4ff59230f48f5ca0da1d6de2f65ec1b4c
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/vm.c
View
@@ -1387,6 +1387,8 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
ci->mid = mid;
ci->proc = m;
ci->stackent = mrb->c->stack;
ci->target_class = c;
ci->pc = pc + 1;
{
int bidx;
mrb_value blk;
@@ -1402,10 +1404,9 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
ci = mrb->c->ci;
}
}
ci->target_class = c;
ci->pc = pc + 1;
/* prepare stack */
mrb->c->stack += a;

0 comments on commit eca35df

Please sign in to comment.