Fix CI misalignment between Fiber#resume and Fiber.yield

When a fiber switched by `Fiber.yield` is resumed by `Fiber#resume` by C, it is necessary to pop CI with `fiber_switch()`.
Previously, CI misalignment caused inconsistencies, including crashes, on the next `Fiber#resume`.
This commit is contained in:
dearblue
2023-12-04 21:51:10 +09:00
parent 568309b25a
commit 42308c42b5
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1839,6 +1839,7 @@ RETRY_TRY_BLOCK:
}
recv = MRB_METHOD_FUNC(m)(mrb, recv);
}
mrb_assert(mrb->c->ci > mrb->c->cibase);
mrb_gc_arena_shrink(mrb, ai);
if (mrb->exc) goto L_RAISE;
ci = mrb->c->ci;