summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-01-16 10:57:10 +0900
committerdearblue <[email protected]>2021-01-16 11:05:15 +0900
commit414a61a9d210dcf797a3a48a3b50c94b60eea780 (patch)
treef785a2fc032e8063aafdc3d6a6073081814d0d71 /src
parent4bba769b951faa370ce210d28bf8cb46734304e6 (diff)
downloadmruby-414a61a9d210dcf797a3a48a3b50c94b60eea780.tar.gz
mruby-414a61a9d210dcf797a3a48a3b50c94b60eea780.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
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;