OP_EPOP operand may be bigger than mrb->c->eidx; fix #3810

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-09-22 13:00:58 +09:00
parent 5760226e71
commit 0ceaa0960a
+3 -1
View File
@@ -1327,7 +1327,9 @@ RETRY_TRY_BLOCK:
NEXT;
}
for (n=0; n<a && mrb->c->eidx > epos; n++) {
if (a > mrb->c->eidx - epos)
a = mrb->c->eidx - epos;
for (n=0; n<a; n++) {
proc = mrb->c->ensure[epos+n];
irep = proc->body.irep;
ci = cipush(mrb);