From 8d64788cbfe9cd735862ec09756dbe22d25f5240 Mon Sep 17 00:00:00 2001 From: dearblue Date: Thu, 24 Oct 2024 22:33:18 +0900 Subject: [PATCH] Fix argument forwarding in `mrb_exec_irep()` C to Ruby calls using `mrb_exec_irep()` were not forwarding arguments. There was also a problem in setting the target class and method ID, which is also fixed. This issue was discovered during the work to fix #6389. --- src/vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vm.c b/src/vm.c index 2d0f9ee98..22b7bcbb8 100644 --- a/src/vm.c +++ b/src/vm.c @@ -828,7 +828,8 @@ mrb_exec_irep(mrb_state *mrb, mrb_value self, struct RProc *p) } else { mrb_int keep = ci_bidx(ci) + 1; /* receiver + block */ - ret = mrb_top_run(mrb, p, self, keep); + cipush(mrb, 0, CINFO_SKIP, CI_TARGET_CLASS(ci), p, NULL, ci->mid, ci->n|(ci->nk<<4)); + ret = mrb_vm_run(mrb, p, self, keep); } if (mrb->exc && mrb->jmp) { mrb_exc_raise(mrb, mrb_obj_value(mrb->exc));