From fcf88c1b8df49ba0c4db026f2b17066ea66d3de2 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 28 Aug 2009 02:45:41 +0000 Subject: * method.h (rb_method_definition_t): split from rb_method_entry_t to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- class.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'class.c') diff --git a/class.c b/class.c index c64cbe72db..1ffb61a46a 100644 --- a/class.c +++ b/class.c @@ -126,17 +126,14 @@ VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase); static int clone_method(ID mid, const rb_method_entry_t *me, struct clone_method_data *data) { - switch (me->type) { - case VM_METHOD_TYPE_ISEQ: { - VALUE newiseqval = rb_iseq_clone(me->body.iseq->self, data->klass); - rb_iseq_t *iseq; - GetISeqPtr(newiseqval, iseq); - rb_add_method(data->klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag); - break; - } - default: + if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) { + VALUE newiseqval = rb_iseq_clone(me->def->body.iseq->self, data->klass); + rb_iseq_t *iseq; + GetISeqPtr(newiseqval, iseq); + rb_add_method(data->klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag); + } + else { rb_add_method_me(data->klass, mid, me, me->flag); - break; } return ST_CONTINUE; } @@ -683,7 +680,7 @@ method_entry(ID key, const rb_method_entry_t *me, st_table *list) } if (!st_lookup(list, key, 0)) { - if (!me || me->type == VM_METHOD_TYPE_UNDEF) { + if (UNDEFINED_METHOD_ENTRY_P(me)) { type = -1; /* none */ } else { -- cgit v1.2.3