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

ruby-changes:43883

From: nagachika <ko1@a...>
Date: Thu, 18 Aug 2016 23:03:42 +0900 (JST)
Subject: [ruby-changes:43883] nagachika:r55956 (ruby_2_3): merge revision(s) 55609: [Backport #12568]

nagachika	2016-08-18 23:03:36 +0900 (Thu, 18 Aug 2016)

  New Revision: 55956

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

  Log:
    merge revision(s) 55609: [Backport #12568]
    
    * vm_args.c (setup_parameters_complex): don't raise ArgumentError
      if an array is given for instance_exec with optional argument.
      [ruby-core:76300] [Bug #12568]
      https://github.com/rails/rails/pull/25699

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/test/ruby/test_lambda.rb
    branches/ruby_2_3/version.h
    branches/ruby_2_3/vm_args.c
Index: ruby_2_3/vm_args.c
===================================================================
--- ruby_2_3/vm_args.c	(revision 55955)
+++ ruby_2_3/vm_args.c	(revision 55956)
@@ -587,6 +587,7 @@ setup_parameters_complex(rb_thread_t * c https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_args.c#L587
       case arg_setup_lambda:
 	if (given_argc == 1 &&
 	    given_argc != iseq->body->param.lead_num &&
+	    !iseq->body->param.flags.has_opt &&
 	    !iseq->body->param.flags.has_rest &&
 	    args_check_block_arg0(args, th)) {
 	    given_argc = RARRAY_LENINT(args->rest);
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 55955)
+++ ruby_2_3/ChangeLog	(revision 55956)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Thu Aug 18 22:52:19 2016  NARUSE, Yui  <naruse@r...>
+
+	* vm_args.c (setup_parameters_complex): don't raise ArgumentError
+	  if an array is given for instance_exec with optional argument.
+	  [ruby-core:76300] [Bug #12568]
+	  https://github.com/rails/rails/pull/25699
+
 Tue Aug 16 12:27:48 2016  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_mark_roots): should mark the VM object itself to mark
Index: ruby_2_3/test/ruby/test_lambda.rb
===================================================================
--- ruby_2_3/test/ruby/test_lambda.rb	(revision 55955)
+++ ruby_2_3/test/ruby/test_lambda.rb	(revision 55956)
@@ -72,6 +72,13 @@ class TestLambdaParameters < Test::Unit: https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_lambda.rb#L72
     assert_raise(ArgumentError, bug9605) {proc(&plus).call [1,2]}
   end
 
+  def test_instance_exec
+    bug12568 = '[ruby-core:76300] [Bug #12568]'
+    assert_nothing_raised(ArgumentError, bug12568) do
+      instance_exec([1,2,3], &->(a=[]){ a })
+    end
+  end
+
   def yield_1(arg)
     yield arg
   end
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 55955)
+++ ruby_2_3/version.h	(revision 55956)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
-#define RUBY_RELEASE_DATE "2016-08-16"
-#define RUBY_PATCHLEVEL 167
+#define RUBY_RELEASE_DATE "2016-08-18"
+#define RUBY_PATCHLEVEL 168
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 16
+#define RUBY_RELEASE_DAY 18
 
 #include "ruby/version.h"
 

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r55609


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

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