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

ruby-changes:50305

From: naruse <ko1@a...>
Date: Fri, 16 Feb 2018 16:32:17 +0900 (JST)
Subject: [ruby-changes:50305] naruse:r62420 (ruby_2_5): merge revision(s) 61603: [Backport #14279]

naruse	2018-02-16 16:32:11 +0900 (Fri, 16 Feb 2018)

  New Revision: 62420

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

  Log:
    merge revision(s) 61603: [Backport #14279]
    
    check array for zsuper. [Bug #14279]
    
    * compile.c (iseq_compile_each0): for zsuper (NODE_ZSUPER), we need to check
      given argument is Array or not.
    
    * test/ruby/test_super.rb: add a test for this bug.

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/compile.c
    branches/ruby_2_5/test/ruby/test_super.rb
    branches/ruby_2_5/version.h
Index: ruby_2_5/compile.c
===================================================================
--- ruby_2_5/compile.c	(revision 62419)
+++ ruby_2_5/compile.c	(revision 62420)
@@ -6181,7 +6181,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/ruby_2_5/compile.c#L6181
 	    if (liseq->body->param.flags.has_rest) {
 		/* rest argument */
 		int idx = liseq->body->local_table_size - liseq->body->param.rest_start;
+
 		ADD_GETLOCAL(args, line, idx, lvar_level);
+		ADD_INSN1(args, line, splatarray, Qfalse);
 
 		argc = liseq->body->param.rest_start + 1;
 		flag |= VM_CALL_ARGS_SPLAT;
Index: ruby_2_5/version.h
===================================================================
--- ruby_2_5/version.h	(revision 62419)
+++ ruby_2_5/version.h	(revision 62420)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1
 #define RUBY_VERSION "2.5.0"
-#define RUBY_RELEASE_DATE "2018-01-30"
-#define RUBY_PATCHLEVEL 13
+#define RUBY_RELEASE_DATE "2018-02-16"
+#define RUBY_PATCHLEVEL 14
 
 #define RUBY_RELEASE_YEAR 2018
-#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 30
+#define RUBY_RELEASE_MONTH 2
+#define RUBY_RELEASE_DAY 16
 
 #include "ruby/version.h"
 
Index: ruby_2_5/test/ruby/test_super.rb
===================================================================
--- ruby_2_5/test/ruby/test_super.rb	(revision 62419)
+++ ruby_2_5/test/ruby/test_super.rb	(revision 62420)
@@ -544,4 +544,20 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_super.rb#L544
       c.new
     }
   end
+
+  class TestFor_super_with_modified_rest_parameter_base
+    def foo *args
+      args
+    end
+  end
+
+  class TestFor_super_with_modified_rest_parameter < TestFor_super_with_modified_rest_parameter_base
+    def foo *args
+      args = 13
+      super
+    end
+  end
+  def test_super_with_modified_rest_parameter
+    assert_equal [13], TestFor_super_with_modified_rest_parameter.new.foo
+  end
 end
Index: ruby_2_5
===================================================================
--- ruby_2_5	(revision 62419)
+++ ruby_2_5	(revision 62420)

Property changes on: ruby_2_5
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r61603

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

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