[前][次][番号順一覧][スレッド一覧]

ruby-changes:35174

From: nagachika <ko1@a...>
Date: Sat, 23 Aug 2014 02:49:45 +0900 (JST)
Subject: [ruby-changes:35174] nagachika:r47256 (ruby_2_1): merge revision(s) r47037: [Backport #10106]

nagachika	2014-08-23 02:49:32 +0900 (Sat, 23 Aug 2014)

  New Revision: 47256

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47256

  Log:
    merge revision(s) r47037: [Backport #10106]
    
    * vm_insnhelper.c (vm_call_method): unusable super class should cause
      method missing when BasicObject is refined but not been using.
      [ruby-core:64166] [Bug #10106]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/test/ruby/test_refinement.rb
    branches/ruby_2_1/version.h
    branches/ruby_2_1/vm_insnhelper.c
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47255)
+++ ruby_2_1/ChangeLog	(revision 47256)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Sat Aug 23 02:39:20 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_insnhelper.c (vm_call_method): unusable super class should cause
+	  method missing when BasicObject is refined but not been using.
+	  [ruby-core:64166] [Bug #10106]
+
 Sat Aug 23 02:22:02 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* string.c (rb_str_count): fix wrong single-byte optimization.
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47255)
+++ ruby_2_1/version.h	(revision 47256)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
 #define RUBY_RELEASE_DATE "2014-08-23"
-#define RUBY_PATCHLEVEL 206
+#define RUBY_PATCHLEVEL 207
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_1/vm_insnhelper.c
===================================================================
--- ruby_2_1/vm_insnhelper.c	(revision 47255)
+++ ruby_2_1/vm_insnhelper.c	(revision 47256)
@@ -1791,6 +1791,10 @@ vm_call_method(rb_thread_t *th, rb_contr https://github.com/ruby/ruby/blob/trunk/ruby_2_1/vm_insnhelper.c#L1791
 		klass = RCLASS_ORIGIN(klass);
 	      zsuper_method_dispatch:
 		klass = RCLASS_SUPER(klass);
+		if (!klass) {
+		    ci->me = 0;
+		    goto start_method_dispatch;
+		}
 		ci_temp = *ci;
 		ci = &ci_temp;
 
Index: ruby_2_1/test/ruby/test_refinement.rb
===================================================================
--- ruby_2_1/test/ruby/test_refinement.rb	(revision 47255)
+++ ruby_2_1/test/ruby/test_refinement.rb	(revision 47256)
@@ -1152,6 +1152,21 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_refinement.rb#L1152
     INPUT
   end
 
+  def test_refine_basic_object
+    assert_separately([], <<-"end;")
+    bug10106 = '[ruby-core:64166] [Bug #10106]'
+    module RefinementBug
+      refine BasicObject do
+        def foo
+          1
+        end
+      end
+    end
+
+    assert_raise(NoMethodError, bug10106) {Object.new.foo}
+    end;
+  end
+
   private
 
   def eval_using(mod, s)

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r47037


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]