summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 11:10:16 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 11:10:16 (GMT)
commitc3cc282f7f23abb36c10e4df489c04976b9b4004 (patch)
tree1e32deac9ee694c480fd5e81bcb4e6327776e73b /class.c
parent5ac1972c1a7b56aa1aace73b30c1a8fcd8705ac8 (diff)
* class.c (clone_method): remove redundant check for me->def != NULL.
Now, all `me` have `me->def`. * proc.c (rb_method_entry_location): ditto. * vm.c (rb_vm_check_redefinition_opt_method): ditto. * vm.c (add_opt_method): ditto. * vm_eval.c (vm_call0_body): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/class.c b/class.c
index e4b6cfd..da41d85 100644
--- a/class.c
+++ b/class.c
@@ -243,21 +243,16 @@ rb_class_new(VALUE super)
static void
clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
{
- if (me->def) {
- 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, klass);
- rb_vm_rewrite_cref_stack(me->def->body.iseq.cref, me->klass, klass, &new_cref);
- rb_add_method_iseq(klass, mid, newiseqval, new_cref, me->def->flags.visi);
- RB_GC_GUARD(newiseqval);
- }
- else {
- rb_method_entry_set(klass, mid, me, me->def->flags.visi);
- }
+ 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, klass);
+ rb_vm_rewrite_cref_stack(me->def->body.iseq.cref, me->klass, klass, &new_cref);
+ rb_add_method_iseq(klass, mid, newiseqval, new_cref, me->def->flags.visi);
+ RB_GC_GUARD(newiseqval);
}
else {
- rb_bug("clone_method: unsupported");
+ rb_method_entry_set(klass, mid, me, me->def->flags.visi);
}
}