From 414a61a9d210dcf797a3a48a3b50c94b60eea780 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 16 Jan 2021 10:57:10 +0900 Subject: Fixed stack position of return value; ref #5272 When I `#call` the "proc" object created by the `mrb_proc_new_cfunc()` function from Ruby space, the return value did not go into the correct stack position. This can destroy the calling variable. This issue is now caused by #5272. sorry. --- src/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/vm.c b/src/vm.c index bbe812997..3ea594250 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1515,7 +1515,7 @@ RETRY_TRY_BLOCK: /* pop stackpos */ ci = cipop(mrb); pc = ci->pc; - regs[ci->acc] = recv; + regs[ci[1].acc] = recv; irep = mrb->c->ci->proc->body.irep; pool = irep->pool; syms = irep->syms; -- cgit v1.2.3