mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Avoid copying over initialized procs using initialize_copy; fix #3803
It may be better to raise exceptions, but CRuby doesn't.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user