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

ruby-changes:45761

From: naruse <ko1@a...>
Date: Sat, 11 Mar 2017 20:06:43 +0900 (JST)
Subject: [ruby-changes:45761] naruse:r57834 (ruby_2_4): merge revision(s) 57194: [Backport #13074]

naruse	2017-03-11 20:06:39 +0900 (Sat, 11 Mar 2017)

  New Revision: 57834

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

  Log:
    merge revision(s) 57194: [Backport #13074]
    
    vm_eval.c: Symbol#to_proc and instance_exec
    
    * vm_eval.c (yield_under): should evaluate the proc on the first
      argument.  [ruby-core:78839] [Bug #13074]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/test/ruby/test_symbol.rb
    branches/ruby_2_4/version.h
    branches/ruby_2_4/vm_eval.c
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 57833)
+++ ruby_2_4/version.h	(revision 57834)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.0"
 #define RUBY_RELEASE_DATE "2017-03-11"
-#define RUBY_PATCHLEVEL 4
+#define RUBY_PATCHLEVEL 5
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_4/test/ruby/test_symbol.rb
===================================================================
--- ruby_2_4/test/ruby/test_symbol.rb	(revision 57833)
+++ ruby_2_4/test/ruby/test_symbol.rb	(revision 57834)
@@ -194,6 +194,12 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_symbol.rb#L194
     end;
   end
 
+  def test_to_proc_instance_exec
+    bug = '[ruby-core:78839] [Bug #13074] should evaluate on the argument'
+    assert_equal(2, BasicObject.new.instance_exec(1, &:succ), bug)
+    assert_equal(3, BasicObject.new.instance_exec(1, 2, &:+), bug)
+  end
+
   def test_call
     o = Object.new
     def o.foo(x, y); x + y; end
Index: ruby_2_4/vm_eval.c
===================================================================
--- ruby_2_4/vm_eval.c	(revision 57833)
+++ ruby_2_4/vm_eval.c	(revision 57834)
@@ -1591,7 +1591,8 @@ yield_under(VALUE under, VALUE self, int https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm_eval.c#L1591
 	    block_handler = vm_proc_to_block_handler(VM_BH_TO_PROC(block_handler));
 	    goto again;
 	  case block_handler_type_symbol:
-	    return rb_sym_proc_call(SYM2ID(VM_BH_TO_SYMBOL(block_handler)), 1, &self, VM_BLOCK_HANDLER_NONE);
+	    return rb_sym_proc_call(SYM2ID(VM_BH_TO_SYMBOL(block_handler)),
+				    argc, argv, VM_BLOCK_HANDLER_NONE);
 	}
 
 	new_captured.self = self;

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57194


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

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