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

ruby-changes:40692

From: nagachika <ko1@a...>
Date: Sat, 28 Nov 2015 06:09:33 +0900 (JST)
Subject: [ruby-changes:40692] nagachika:r52771 (ruby_2_2): merge revision(s) 51427: [Backport #10969]

nagachika	2015-11-28 06:09:19 +0900 (Sat, 28 Nov 2015)

  New Revision: 52771

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

  Log:
    merge revision(s) 51427: [Backport #10969]
    
    * vm_eval.c (send_internal): set method_missing_reason before
      invoking overriding method_missing method so that the default
      method_missing can achieve it properly.
      [ruby-core:68515] [Bug #10969]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/test/ruby/test_exception.rb
    branches/ruby_2_2/version.h
    branches/ruby_2_2/vm_eval.c
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 52770)
+++ ruby_2_2/ChangeLog	(revision 52771)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Sat Nov 28 05:50:58 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_eval.c (send_internal): set method_missing_reason before
+	  invoking overriding method_missing method so that the default
+	  method_missing can achieve it properly.
+	  [ruby-core:68515] [Bug #10969]
+
 Sat Nov 28 05:47:27 2015  Rei Odaira  <Rei.Odaira@g...>
 
 	* test/ruby/test_symbol.rb (test_symbol_fstr_leak): add a warm-up
Index: ruby_2_2/vm_eval.c
===================================================================
--- ruby_2_2/vm_eval.c	(revision 52770)
+++ ruby_2_2/vm_eval.c	(revision 52771)
@@ -926,6 +926,7 @@ send_internal(int argc, const VALUE *arg https://github.com/ruby/ruby/blob/trunk/ruby_2_2/vm_eval.c#L926
 	    }
 	}
 	id = idMethodMissing;
+	th->method_missing_reason = 0;
     }
     else {
 	argv++; argc--;
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 52770)
+++ ruby_2_2/version.h	(revision 52771)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.4"
 #define RUBY_RELEASE_DATE "2015-11-28"
-#define RUBY_PATCHLEVEL 203
+#define RUBY_PATCHLEVEL 204
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 11
Index: ruby_2_2/test/ruby/test_exception.rb
===================================================================
--- ruby_2_2/test/ruby/test_exception.rb	(revision 52770)
+++ ruby_2_2/test/ruby/test_exception.rb	(revision 52771)
@@ -698,4 +698,11 @@ $stderr = $stdout; raise "\x82\xa0"') do https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_exception.rb#L698
       raise E
     end;
   end
+
+  def test_method_missing_reason_clear
+    bug10969 = '[ruby-core:68515] [Bug #10969]'
+    a = Class.new {def method_missing(*) super end}.new
+    assert_raise(NameError) {a.instance_eval("foo")}
+    assert_raise(NoMethodError, bug10969) {a.public_send("bar", true)}
+  end
 end

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r51427


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

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