Commit f0462b41 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #417 from MobiRuby/crash_when_called_stack_ext

Fixed memory leak when calling stack_extend in m->body.func
parents 52ba6f5a 3718599e
......@@ -689,7 +689,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
struct RProc *m;
struct RClass *c;
mrb_callinfo *ci;
mrb_value recv;
mrb_value recv, result;
mrb_sym mid = syms[GETARG_B(i)];
recv = regs[a];
......@@ -731,7 +731,8 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
else {
ci->nregs = n + 2;
}
mrb->stack[0] = m->body.func(mrb, recv);
result = m->body.func(mrb, recv);
mrb->stack[0] = result;
mrb->arena_idx = ai;
if (mrb->exc) goto L_RAISE;
/* pop stackpos */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment