Fixed off-by-one error in fiber_switch(); ref #3641

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-05-26 01:24:28 +09:00
parent f75f506181
commit 7e4731655f
+1 -1
View File
@@ -190,7 +190,7 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
if (c->status == MRB_FIBER_CREATED) {
mrb_value *b, *e;
if (len > c->stend - c->stack) {
if (len >= c->stend - c->stack) {
mrb_raise(mrb, E_FIBER_ERROR, "too many arguments to fiber");
}
b = c->stack+1;