summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/proc.c b/src/proc.c
index e11cb7fec..01a69fbf1 100644
--- a/src/proc.c
+++ b/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; */
}