Skip to content
Permalink
Browse files
proc.c: should not reference irep when copying failed.
It may cause broken reference count numbers.
  • Loading branch information
matz committed Jan 1, 2022
1 parent 3de9ddf commit 28ccc664e5dcd3f9d55173e9afde77c4705a9ab6
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/proc.c
@@ -207,12 +207,12 @@ mrb_proc_copy(mrb_state *mrb, struct RProc *a, struct RProc *b)
/* already initialized proc */
return;
}
if (!MRB_PROC_CFUNC_P(b) && b->body.irep) {
mrb_irep_incref(mrb, (mrb_irep*)b->body.irep);
}
a->flags = b->flags;
a->body = b->body;
a->upper = b->upper;
if (!MRB_PROC_CFUNC_P(a) && a->body.irep) {
mrb_irep_incref(mrb, (mrb_irep*)a->body.irep);
}
a->e.env = b->e.env;
/* a->e.target_class = a->e.target_class; */
}

0 comments on commit 28ccc66

Please sign in to comment.