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.
This commit is contained in:
dearblue
2021-01-16 10:57:10 +09:00
parent 4bba769b95
commit 414a61a9d2
+1 -1
View File
@@ -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;