mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fibers cannot cross C function boundary; close #1680
This commit is contained in:
@@ -218,9 +218,15 @@ static mrb_value
|
||||
fiber_yield(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
struct mrb_context *c = mrb->c;
|
||||
mrb_callinfo *ci;
|
||||
mrb_value *a;
|
||||
int len;
|
||||
int i, len;
|
||||
|
||||
for (ci = c->ci; ci >= c->cibase; ci--) {
|
||||
if (ci->acc < 0) {
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "can't cross C function boundary");
|
||||
}
|
||||
}
|
||||
if (!c->prev) {
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "can't yield from root fiber");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user