summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-07-02 21:57:52 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-07-02 21:57:52 +0900
commita624da6fdb160b9a70a96c1ffe9dec017d7f5cb4 (patch)
tree04816f7c7e8d318eff216218b51a9ecde7baae93 /src/vm.c
parent040d1799ecadaf4cca83d8e250c3ca268a363e09 (diff)
downloadmruby-a624da6fdb160b9a70a96c1ffe9dec017d7f5cb4.tar.gz
mruby-a624da6fdb160b9a70a96c1ffe9dec017d7f5cb4.zip
vm.c: need to adjust `pc` for `OP_EXT[123]`.
Diffstat (limited to 'src/vm.c')
-rw-r--r--src/vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vm.c b/src/vm.c
index a8a3f91d7..3a7d2ac8f 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -2887,7 +2887,7 @@ RETRY_TRY_BLOCK:
CASE(OP_EXT1, Z) {
insn = READ_B();
switch (insn) {
-#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _1(); goto L_OP_ ## insn ## _BODY;
+#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _1(); mrb->c->ci->pc = pc; goto L_OP_ ## insn ## _BODY;
#include "mruby/ops.h"
#undef OPCODE
}
@@ -2897,7 +2897,7 @@ RETRY_TRY_BLOCK:
CASE(OP_EXT2, Z) {
insn = READ_B();
switch (insn) {
-#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _2(); goto L_OP_ ## insn ## _BODY;
+#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _2(); mrb->c->ci->pc = pc; goto L_OP_ ## insn ## _BODY;
#include "mruby/ops.h"
#undef OPCODE
}
@@ -2907,7 +2907,7 @@ RETRY_TRY_BLOCK:
CASE(OP_EXT3, Z) {
uint8_t insn = READ_B();
switch (insn) {
-#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _3(); goto L_OP_ ## insn ## _BODY;
+#define OPCODE(insn,ops) case OP_ ## insn: FETCH_ ## ops ## _3(); mrb->c->ci->pc = pc; goto L_OP_ ## insn ## _BODY;
#include "mruby/ops.h"
#undef OPCODE
}