should check crossing C boudary from resume

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-05 15:38:13 +09:00
parent f911b23599
commit 865b850b76
+6
View File
@@ -154,7 +154,13 @@ fiber_resume(mrb_state *mrb, mrb_value self)
struct mrb_context *c = fiber_check(mrb, self);
mrb_value *a;
int len;
mrb_callinfo *ci;
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->status == MRB_FIBER_RESUMED) {
mrb_raise(mrb, E_RUNTIME_ERROR, "double resume");
}