Merge pull request #6076 from dearblue/fiber-unwinding

Fixed unwinding block that could point to invalid PC
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-10-13 20:33:03 +07:00
committed by GitHub
+1 -2
View File
@@ -2210,14 +2210,13 @@ RETRY_TRY_BLOCK:
if (mrb->exc) {
L_RAISE:
ci = mrb->c->ci;
while ((ch = catch_handler_find(mrb, ci, pc, MRB_CATCH_FILTER_ALL)) == NULL) {
while ((ch = catch_handler_find(mrb, ci, ci->pc, MRB_CATCH_FILTER_ALL)) == NULL) {
if (ci != mrb->c->cibase) {
ci = cipop(mrb);
if (ci[1].cci == CINFO_SKIP && prev_jmp) {
mrb->jmp = prev_jmp;
MRB_THROW(prev_jmp);
}
pc = ci[0].pc;
}
else if (mrb->c == mrb->root_c) {
mrb->c->ci->stack = mrb->c->stbase;