diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-18 08:15:51 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-18 08:15:51 +0000 |
commit | 3f7c0e9fd567fcfbcc8d2ac3ab8499cb321b3073 (patch) | |
tree | 659cc9ee4ffe825840cf55fb7db713e3fd48ca41 /vm_insnhelper.c | |
parent | e2f0af57407859b1d094e6885c27dabff345c190 (diff) | |
download | ruby-3f7c0e9fd567fcfbcc8d2ac3ab8499cb321b3073.tar.gz |
* method.h: introduce the folliwing field and macros.
* rb_method_definition_t::complemented_count to count shared method
entries because of complemented method entries and separate from
alias_count.
Shared `def' only by complemented method entries should not prevent
method re-definition warning.
* METHOD_ENTRY_COMPLEMENTED(me) to represent complemented method entry.
* METHOD_ENTRY_COMPLEMENTED_SET(me) to check it as complemented me.
* vm_insnhelper.c (aliased_callable_method_entry): should also
check me->def->complemented_count.
* vm_method.c (method_definition_addref_complement): add to count
complemented method entries number.
* vm_method.c (rb_method_definition_release): release `def' iff
alias_count == 0 and complemented_count == 0.
* test/ruby/test_module.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index ecf203c01d..3b89b3a695 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1990,7 +1990,7 @@ aliased_callable_method_entry(const rb_callable_method_entry_t *me) VM_ASSERT(RB_TYPE_P(orig_me->owner, T_MODULE)); cme = rb_method_entry_complement_defined_class(orig_me, defined_class); - if (me->def->alias_count == 0) { + if (me->def->alias_count + me->def->complemented_count == 0) { RB_OBJ_WRITE(me, &me->def->body.alias.original_me, cme); } else { |