diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-29 03:11:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-29 03:11:17 +0000 |
commit | a69f01fa52e3ab47fa700442251f73f47846bb9f (patch) | |
tree | 21edfbc648546117d533a5c0eb1aebaab98964ab | |
parent | cb08e708227216bd2810a6bda18140467d23cb34 (diff) | |
download | ruby-a69f01fa52e3ab47fa700442251f73f47846bb9f.tar.gz |
proc.c: fix inherited method owner
* proc.c (mnew_from_me): keep iclass as-is, to make inheritance
chain consistent. [ruby-core:59358] [Bug #9315]
* proc.c (method_owner): return the original defined_class from
prepended iclass, instead.
* vm_insnhelper.c (vm_search_super_method): revert r44455, no
longer defined_class becomes a module.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | proc.c | 13 | ||||
-rw-r--r-- | vm_insnhelper.c | 5 |
3 files changed, 16 insertions, 17 deletions
@@ -1,15 +1,16 @@ +Sun Dec 29 12:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * proc.c (mnew_from_me): keep iclass as-is, to make inheritance + chain consistent. [ruby-core:59358] [Bug #9315] + + * proc.c (method_owner): return the original defined_class from + prepended iclass, instead. + Sun Dec 29 08:47:24 2013 Lucas Allan Amorim <lucas.allan@gmail.com> * test/ruby/test_sprintf.rb (test_hash): Added tests for sprintf with a hash as parameter. [Fixes GH-491] -Sun Dec 29 08:21:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * vm_insnhelper.c (vm_search_super_method): direct superclass of a - module is found when super called in a Method object generated a - method defined in a module, call method_missing in that case. - [ruby-core:59358] [Bug #9315] - Sun Dec 29 07:27:51 2013 Benoit Daloze <eregontp@gmail.com> * compar.c (cmp_eq_recursive): Fix the return value, the value for @@ -1224,10 +1224,6 @@ mnew_from_me(rb_method_entry_t *me, VALUE defined_class, VALUE klass, goto again; } - if (RB_TYPE_P(defined_class, T_ICLASS)) { - defined_class = RBASIC_CLASS(defined_class); - } - klass = defined_class; while (rclass != klass && @@ -1449,9 +1445,16 @@ static VALUE method_owner(VALUE obj) { struct METHOD *data; + VALUE defined_class; TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data); - return data->defined_class; + defined_class = data->defined_class; + + if (RB_TYPE_P(defined_class, T_ICLASS)) { + defined_class = RBASIC_CLASS(defined_class); + } + + return defined_class; } void diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 8694f524f6..c8cbaa07bf 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2024,11 +2024,6 @@ vm_search_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_inf " by define_method() is not supported." " Specify all arguments explicitly."); } - if (!ci->klass) { - ci->aux.missing_reason = NOEX_SUPER; - CI_SET_FASTPATH(ci, vm_call_method_missing, 1); - return; - } /* TODO: use inline cache */ ci->me = rb_method_entry(ci->klass, ci->mid, &ci->defined_class); |