Revert "No longer need to insert write barriers for fibers."

This reverts commit c6736357a7.
The assumption was wrong and caused the issue; fix #4020
This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-06-11 14:50:42 +09:00
parent a9b740b36b
commit 23a4e7149d
2 changed files with 12 additions and 1 deletions
+9 -1
View File
@@ -949,7 +949,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;
}
@@ -1942,6 +1947,9 @@ RETRY_TRY_BLOCK:
while (c->eidx > ci->epos) {
ecall_adjust();
}
if (c->fib) {
mrb_write_barrier(mrb, (struct RBasic*)c->fib);
}
mrb->c->status = MRB_FIBER_TERMINATED;
mrb->c = c->prev;
c->prev = NULL;