Commit 1c2fc94c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2867 from kou/proc-fix-gc-crash

Fix a crash bug when GC is ran while creating a proc with env
parents b0ec992d 52db92de
......@@ -93,6 +93,7 @@ mrb_proc_new_cfunc_with_env(mrb_state *mrb, mrb_func_t func, mrb_int argc, const
int i;
p->env = e = env_new(mrb, argc);
mrb_field_write_barrier(mrb, (struct RBasic *)p, (struct RBasic *)p->env);
MRB_ENV_UNSHARE_STACK(e);
e->stack = (mrb_value*)mrb_malloc(mrb, sizeof(mrb_value) * argc);
if (argv) {
......
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