path: root/class.c
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 02:27:41 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 02:27:41 (GMT)
commit16a68369d2c12dd6aae1b902aac5fe72b9ee9ec9 (patch)
tree842f782ad31311302595371b3bfb78311fd9fedd /class.c
parentbbf7495fe223c7ab8235bf372c1164ab4e70633b (diff)
* iseq.c, internal.h (rb_iseq_clone): removed because we don't need to
clone iseq any more. * class.c (clone_method): share iseq between cloned methods. All of method dependent information are able to refer from method entry. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
1 files changed, 1 insertions, 3 deletions
diff --git a/class.c b/class.c
index 0521cf9..46a0d61 100644
--- a/class.c
+++ b/class.c
@@ -244,11 +244,9 @@ static void
clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *me)
if (me->def->type == VM_METHOD_TYPE_ISEQ) {
- VALUE newiseqval;
rb_cref_t *new_cref;
- newiseqval = rb_iseq_clone(me->def->body.iseq.iseqptr->self, new_klass);
rb_vm_rewrite_cref(me->def->body.iseq.cref, old_klass, new_klass, &new_cref);
- rb_add_method_iseq(new_klass, mid, newiseqval, new_cref, METHOD_ENTRY_VISI(me));
+ rb_add_method_iseq(new_klass, mid, me->def->body.iseq.iseqptr->self, new_cref, METHOD_ENTRY_VISI(me));
else {
rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me));