mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2867 from kou/proc-fix-gc-crash
Fix a crash bug when GC is ran while creating a proc with env
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user