Protect stack region before calling mrb_convert_type(); fix #3504

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-03-16 21:40:22 +09:00
parent f8b31a0db6
commit b64f08784c
+2
View File
@@ -1207,6 +1207,7 @@ RETRY_TRY_BLOCK:
else {
mrb_value blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
ci->nregs = bidx+1;
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
}
}
@@ -1438,6 +1439,7 @@ RETRY_TRY_BLOCK:
}
blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
ci->nregs = bidx+1;
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
ci = mrb->c->ci;
}