diff options
| -rw-r--r-- | src/proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/proc.c b/src/proc.c index 96b080f9e..10a2c4f33 100644 --- a/src/proc.c +++ b/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) { |
