Call write barriers for stack-modified fibers; fix #3699

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-06-15 23:20:36 +09:00
parent d7e09ffa5f
commit ebd6636a1e
2 changed files with 22 additions and 9 deletions
+9 -1
View File
@@ -867,7 +867,12 @@ mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stac
if (c->ci - c->cibase > cioff) {
c->ci = c->cibase + cioff;
}
mrb->c = c;
if (mrb->c != c) {
if (mrb->c->fib) {
mrb_write_barrier(mrb, (struct RBasic*)mrb->c->fib);
}
mrb->c = c;
}
return result;
}
@@ -1819,6 +1824,9 @@ RETRY_TRY_BLOCK:
else {
struct mrb_context *c = mrb->c;
if (c->fib) {
mrb_write_barrier(mrb, (struct RBasic*)c->fib);
}
mrb->c = c->prev;
c->prev = NULL;
goto L_RAISE;