mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* method.h (METHOD_ENTRY_COMPLEMENTED(_SET)): introduced to recognize
complemented method entries or not. There are some cases that callabe method entries do not have defined_class. * vm_method.c (rb_method_entry_complement_defined_class): use METHOD_ENTRY_COMPLEMENTED_SET(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c88764f369
commit
551ae37ba3
3 changed files with 13 additions and 2 deletions
|
@ -160,7 +160,7 @@ rb_method_definition_release(rb_method_definition_t *def, int complemented)
|
|||
void
|
||||
rb_free_method_entry(const rb_method_entry_t *me)
|
||||
{
|
||||
rb_method_definition_release(me->def, RB_TYPE_P(me->owner, T_MODULE) && RB_TYPE_P(me->defined_class, T_ICLASS));
|
||||
rb_method_definition_release(me->def, METHOD_ENTRY_COMPLEMENTED(me));
|
||||
}
|
||||
|
||||
static inline rb_method_entry_t *search_method(VALUE klass, ID id, VALUE *defined_class_ptr);
|
||||
|
@ -400,9 +400,9 @@ rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, VALUE
|
|||
rb_method_entry_t *me = rb_method_entry_alloc(src_me->called_id, src_me->owner, defined_class,
|
||||
method_definition_addref_complement(src_me->def));
|
||||
METHOD_ENTRY_FLAGS_COPY(me, src_me);
|
||||
METHOD_ENTRY_COMPLEMENTED_SET(me);
|
||||
|
||||
VM_ASSERT(RB_TYPE_P(me->owner, T_MODULE));
|
||||
VM_ASSERT(RB_TYPE_P(me->defined_class, T_ICLASS));
|
||||
|
||||
return (rb_callable_method_entry_t *)me;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue