ruby-changes:49393
From: nobu <ko1@a...>
Date: Thu, 28 Dec 2017 17:28:47 +0900 (JST)
Subject: [ruby-changes:49393] nobu:r61509 (trunk): proc.c: empty iseq names
nobu 2017-12-28 17:28:42 +0900 (Thu, 28 Dec 2017) New Revision: 61509 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61509 Log: proc.c: empty iseq names * proc.c (proc_binding): unified the name and realpath of an empty iseq. Modified files: trunk/proc.c Index: proc.c =================================================================== --- proc.c (revision 61508) +++ proc.c (revision 61509) @@ -2844,12 +2844,15 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2844 const struct vm_ifunc *ifunc = block->as.captured.code.ifunc; if (IS_METHOD_PROC_IFUNC(ifunc)) { VALUE method = (VALUE)ifunc->data; + VALUE name = rb_fstring_cstr("<empty_iseq>"); + rb_iseq_t *empty; binding_self = method_receiver(method); iseq = rb_method_iseq(method); env = VM_ENV_ENVVAL_PTR(block->as.captured.ep); env = env_clone(env, method_cref(method)); /* set empty iseq */ - RB_OBJ_WRITE(env, &env->iseq, rb_iseq_new(NULL, rb_str_new2("<empty iseq>"), rb_str_new2("<empty_iseq>"), Qnil, 0, ISEQ_TYPE_TOP)); + empty = rb_iseq_new(NULL, name, name, Qnil, 0, ISEQ_TYPE_TOP); + RB_OBJ_WRITE(env, &env->iseq, empty); break; } else { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/