summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-11 05:42:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-11 05:42:31 +0000
commitc27c68b8db983e186ab030bb5278bcf16fd055c1 (patch)
tree1a2d5b1fd5bd27e7d1966c033d6e41f333f7c86e /class.c
parent729615e6cddd0efa45dae8d5b9651437ef8f034c (diff)
* 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@18485 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;