From 98d5aa8d742dfd314e492a0649aef6fd324665f4 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 1 Dec 2020 00:20:13 +0900 Subject: Fix `OP_JMPUW` address bug. --- src/vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vm.c b/src/vm.c index 6cb32f68e..bc5ef8579 100644 --- a/src/vm.c +++ b/src/vm.c @@ -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; } -- cgit v1.2.3