mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
should check crossing C boudary from resume
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user