diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-02 13:54:38 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-02 13:54:38 +0000 |
commit | 997f821a58a7295436e64443ab4bd1d550cd6919 (patch) | |
tree | 258704c1655f73fefad13e3d76882324abede381 /proc.c | |
parent | 00a360a93dc9ac5e32cfa56600b2a10ea42c685a (diff) |
merge revision(s) r48160: [Backport #10432]
* proc.c (method_proc): the receiver of binding from method should
be same as the receiver of the method.
[ruby-core:65917] [Bug #10432]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2317,7 +2317,10 @@ static VALUE method_proc(VALUE method) { VALUE procval; + struct METHOD *meth; rb_proc_t *proc; + rb_env_t *env; + /* * class Method * def to_proc @@ -2327,9 +2330,16 @@ method_proc(VALUE method) * end * end */ + TypedData_Get_Struct(method, struct METHOD, &method_data_type, meth); procval = rb_iterate(mlambda, 0, bmcall, method); GetProcPtr(procval, proc); proc->is_from_method = 1; + proc->block.self = meth->recv; + proc->block.klass = meth->defined_class; + GetEnvPtr(proc->envval, env); + env->block.self = meth->recv; + env->block.klass = meth->defined_class; + env->block.iseq = method_get_iseq(meth->me->def); return procval; } |