diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-12-01 00:20:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-12-01 00:25:09 +0900 |
| commit | 98d5aa8d742dfd314e492a0649aef6fd324665f4 (patch) | |
| tree | 37fa82d2c7ef1ede0ae8a3bfe9f83a12a7f5b6e4 | |
| parent | 1c361f8a22e9a5506e8461b7b76e21e36ba36f9d (diff) | |
| download | mruby-98d5aa8d742dfd314e492a0649aef6fd324665f4.tar.gz mruby-98d5aa8d742dfd314e492a0649aef6fd324665f4.zip | |
Fix `OP_JMPUW` address bug.
| -rw-r--r-- | src/vm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |
