ruby-changes:37250
From: naruse <ko1@a...>
Date: Mon, 19 Jan 2015 15:46:44 +0900 (JST)
Subject: [ruby-changes:37250] naruse:r49331 (ruby_2_2): merge revision(s) 49184: [Backport #10707]
naruse 2015-01-19 15:46:29 +0900 (Mon, 19 Jan 2015) New Revision: 49331 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49331 Log: merge revision(s) 49184: [Backport #10707] * vm_method.c (rb_method_entry): if no super class, no original method entry. [ruby-core:67389] [Bug #10707] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/test/ruby/test_refinement.rb branches/ruby_2_2/version.h branches/ruby_2_2/vm_method.c Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 49330) +++ ruby_2_2/ChangeLog (revision 49331) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Mon Jan 19 15:45:33 2015 Seiei Higa <hanachin@g...> + + * vm_method.c (rb_method_entry): if no super class, no original + method entry. [ruby-core:67389] [Bug #10707] + Mon Jan 19 12:03:59 2015 Nobuyoshi Nakada <nobu@r...> * vm_dump.c (rb_vm_bugreport): check by configured result instead Index: ruby_2_2/vm_method.c =================================================================== --- ruby_2_2/vm_method.c (revision 49330) +++ ruby_2_2/vm_method.c (revision 49331) @@ -668,12 +668,17 @@ get_original_method_entry(VALUE refineme https://github.com/ruby/ruby/blob/trunk/ruby_2_2/vm_method.c#L668 const rb_method_entry_t *me, VALUE *defined_class_ptr) { + VALUE super; + if (me->def->body.orig_me) { return me->def->body.orig_me; } + else if (!(super = RCLASS_SUPER(me->klass))) { + return 0; + } else { rb_method_entry_t *tmp_me; - tmp_me = rb_method_entry(RCLASS_SUPER(me->klass), me->called_id, + tmp_me = rb_method_entry(super, me->called_id, defined_class_ptr); return rb_resolve_refined_method(refinements, tmp_me, defined_class_ptr); Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 49330) +++ ruby_2_2/version.h (revision 49331) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.0" #define RUBY_RELEASE_DATE "2015-01-19" -#define RUBY_PATCHLEVEL 31 +#define RUBY_PATCHLEVEL 32 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 1 Index: ruby_2_2/test/ruby/test_refinement.rb =================================================================== --- ruby_2_2/test/ruby/test_refinement.rb (revision 49330) +++ ruby_2_2/test/ruby/test_refinement.rb (revision 49331) @@ -1163,6 +1163,19 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_refinement.rb#L1163 assert_raise(NoMethodError, bug10106) {Object.new.foo} end; + + assert_separately([], <<-"end;") + bug10707 = '[ruby-core:67389] [Bug #10707]' + module RefinementBug + refine BasicObject do + def foo + end + end + end + + assert(methods, bug10707) + assert_raise(NameError, bug10707) {method(:foo)} + end; end def test_change_refined_new_method_visibility Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r49184 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/