summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-16 01:58:45 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-16 01:58:45 +0000
commitbc413e84df0994602f6d83acfb86bc6b0cf00cfe (patch)
treea3c66a054c100d66ce1b13566b8b13f40d956fe6 /class.c
parentdb39c1bdda108cefcf04ea07fd00e8314887c91d (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/class.c b/class.c
index 096c7fbdf1..80f57a1622 100644
--- a/class.c
+++ b/class.c
@@ -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;