Fix OP_JMPUW address bug.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-12-01 00:20:13 +09:00
parent 1c361f8a22
commit 98d5aa8d74
+2 -2
View File
@@ -1300,13 +1300,13 @@ RETRY_TRY_BLOCK:
}
CASE(OP_JMPUW, S) {
a = (pc - irep->iseq) + (int16_t)a;
CHECKPOINT_RESTORE(RBREAK_TAG_JUMP) {
struct RBreak *brk = (struct RBreak*)mrb->exc;
mrb_value target = mrb_break_value_get(brk);
mrb_assert(mrb_integer_p(target));
a = (uint32_t)mrb_integer(target);
mrb_assert(a >= 0 && a < irep->ilen);
a = a - (pc - irep->iseq);
}
CHECKPOINT_MAIN(RBREAK_TAG_JUMP) {
ch = catch_handler_find(mrb, mrb->c->ci, pc, MRB_CATCH_FILTER_ENSURE);
@@ -1320,7 +1320,7 @@ RETRY_TRY_BLOCK:
CHECKPOINT_END(RBREAK_TAG_JUMP);
mrb->exc = NULL; /* clear break object */
pc += (int16_t)a;
pc = irep->iseq + a;
JUMP;
}