fibers cannot cross C function boundary; close #1680

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-02-04 14:01:22 +09:00
parent 33bb4578a2
commit 857e384187
+7 -1
View File
@@ -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");
}