The current context may be changed in mrb_vm_exec; ref #3668 #4104

This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-11-19 09:50:31 +09:00
parent cab6b0f39b
commit 31a961acf1
+3 -3
View File
@@ -973,15 +973,15 @@ mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stac
stack_clear(c->stack + stack_keep, nregs - stack_keep);
c->stack[0] = self;
result = mrb_vm_exec(mrb, proc, irep->iseq);
if (c->ci - c->cibase > cioff) {
c->ci = c->cibase + cioff;
}
if (mrb->c != c) {
if (mrb->c->fib) {
mrb_write_barrier(mrb, (struct RBasic*)mrb->c->fib);
}
mrb->c = c;
}
else if (c->ci - c->cibase > cioff) {
c->ci = c->cibase + cioff;
}
return result;
}