diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-06-11 14:50:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-06-11 14:50:42 +0900 |
| commit | 23a4e7149dc4253caf5ed0a528ffe5c21c4afb80 (patch) | |
| tree | 1320fdd6f2f35e76cbb6313ee5539887e91e8d9c /src/vm.c | |
| parent | a9b740b36b4518552d61f349afc02c325413d2ad (diff) | |
| download | mruby-23a4e7149dc4253caf5ed0a528ffe5c21c4afb80.tar.gz mruby-23a4e7149dc4253caf5ed0a528ffe5c21c4afb80.zip | |
Revert "No longer need to insert write barriers for fibers."
This reverts commit c6736357a72049a0eb2a31ccabcc3cd2baba7c9e.
The assumption was wrong and caused the issue; fix #4020
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |
