mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-fiber/fiber.c: detect resume/transfer mixture; fix #5905
Also, transferred fibers should kick the root fiber at termination.
This commit is contained in:
@@ -2170,19 +2170,18 @@ RETRY_TRY_BLOCK:
|
||||
}
|
||||
pc = ci[0].pc;
|
||||
}
|
||||
else if (mrb->c == mrb->root_c) {
|
||||
mrb->c->ci->stack = mrb->c->stbase;
|
||||
goto L_STOP;
|
||||
}
|
||||
else {
|
||||
if (mrb->c == mrb->root_c) {
|
||||
mrb->c->ci->stack = mrb->c->stbase;
|
||||
goto L_STOP;
|
||||
}
|
||||
else {
|
||||
struct mrb_context *c = mrb->c;
|
||||
struct mrb_context *c = mrb->c;
|
||||
|
||||
c->status = MRB_FIBER_TERMINATED;
|
||||
mrb->c = c->prev;
|
||||
c->prev = NULL;
|
||||
goto L_RAISE;
|
||||
}
|
||||
c->status = MRB_FIBER_TERMINATED;
|
||||
mrb->c = c->prev;
|
||||
c->prev = NULL;
|
||||
if (!mrb->c) mrb->c = mrb->root_c;
|
||||
goto L_RAISE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user