Avoid copying over initialized procs using `initialize_copy`; fix
It may be better to raise exceptions, but CRuby doesn't.
MODIFY
src/proc.c
src/proc.c
@@ -139,6 +139,10 @@ mrb_proc_cfunc_env_get(mrb_state *mrb, mrb_int idx)
void
mrb_proc_copy(struct RProc *a, struct RProc *b)
{
+ if (a->body.irep) {
+ /* already initialized proc */
+ return;
+ }
a->flags = b->flags;
a->body = b->body;
if (!MRB_PROC_CFUNC_P(a) && a->body.irep) {

Avoid copying over initialized procs using `initialize_copy`; fix #3803

It may be better to raise exceptions, but CRuby doesn't.