diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-16 01:58:45 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-16 01:58:45 +0000 |
commit | bc413e84df0994602f6d83acfb86bc6b0cf00cfe (patch) | |
tree | a3c66a054c100d66ce1b13566b8b13f40d956fe6 /class.c | |
parent | db39c1bdda108cefcf04ea07fd00e8314887c91d (diff) |
merge revision(s) 18485:
* class.c (clone_method): should copy cbase in cref as well.
[ruby-dev:35116]
* node.h (NEW_CREF): new NEW_ macro.
* eval.c (PUSH_CREF): use NEW_CREF().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@21583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -62,7 +62,10 @@ clone_method(mid, body, data) NODE *fbody = body->nd_body; if (fbody && nd_type(fbody) == NODE_SCOPE) { - fbody = rb_copy_node_scope(fbody, ruby_cref); + NODE *cref = (NODE*)fbody->nd_rval; + + if (cref) cref = cref->nd_next; + fbody = rb_copy_node_scope(fbody, NEW_CREF(data->klass, cref)); } st_insert(data->tbl, mid, (st_data_t)NEW_METHOD(fbody, body->nd_noex)); return ST_CONTINUE; |