diff options
| author | dearblue <[email protected]> | 2021-01-10 10:50:22 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-01-10 13:23:43 +0900 |
| commit | ced89c25ffc9ac748dc2dd336cce24d080ebf419 (patch) | |
| tree | c72aa35170876cf2904315a43a383127f796ce34 /mrbgems/mruby-fiber | |
| parent | 16baea06771f38fea810ad1eaf3239086442c258 (diff) | |
| download | mruby-ced89c25ffc9ac748dc2dd336cce24d080ebf419.tar.gz mruby-ced89c25ffc9ac748dc2dd336cce24d080ebf419.zip | |
Unified `pc` and `err` of `mrb_callinfo`
This enhances self-containment.
- Changed the `mrb_callinfo::pc` field to point to itself.
Previously it indicated the return destination of the previous call level.
`mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`.
- Removed `mrb_callinfo::err` field.
This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`.
- The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted.
- It removes the argument because `cipush()` doesn't need to save the previous `pc`.
Diffstat (limited to 'mrbgems/mruby-fiber')
| -rw-r--r-- | mrbgems/mruby-fiber/src/fiber.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mrbgems/mruby-fiber/src/fiber.c b/mrbgems/mruby-fiber/src/fiber.c index d75f864c1..7fd755843 100644 --- a/mrbgems/mruby-fiber/src/fiber.c +++ b/mrbgems/mruby-fiber/src/fiber.c @@ -119,9 +119,8 @@ fiber_init(mrb_state *mrb, mrb_value self) /* adjust return callinfo */ ci = c->ci; mrb_vm_ci_target_class_set(ci, MRB_PROC_TARGET_CLASS(p)); - ci->proc = p; + mrb_vm_ci_proc_set(ci, p); mrb_field_write_barrier(mrb, (struct RBasic*)mrb_obj_ptr(self), (struct RBasic*)p); - ci->pc = p->body.irep->iseq; ci->stack = c->stbase; ci[1] = ci[0]; c->ci++; /* push dummy callinfo */ |
