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

ruby-changes:40708

From: nagachika <ko1@a...>
Date: Sun, 29 Nov 2015 18:01:34 +0900 (JST)
Subject: [ruby-changes:40708] nagachika:r52787 (ruby_2_2): merge revision(s) 52536: [Backport #11674]

nagachika	2015-11-29 18:01:12 +0900 (Sun, 29 Nov 2015)

  New Revision: 52787

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

  Log:
    merge revision(s) 52536: [Backport #11674]
    
    * vm_eval.c (local_var_list_add): skip internal local variable
      name by its type but not if it has a name.  internal local
      variable names are just unique per frame, not globally.
      [ruby-core:71437] [Bug #11674]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/test/ruby/test_variable.rb
    branches/ruby_2_2/version.h
    branches/ruby_2_2/vm_eval.c
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 52786)
+++ ruby_2_2/ChangeLog	(revision 52787)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Sun Nov 29 17:48:39 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_eval.c (local_var_list_add): skip internal local variable
+	  name by its type but not if it has a name.  internal local
+	  variable names are just unique per frame, not globally.
+	  [ruby-core:71437] [Bug #11674]
+
 Sun Nov 29 17:13:16 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (rb_io_each_codepoint): read more data when read partially.
Index: ruby_2_2/vm_eval.c
===================================================================
--- ruby_2_2/vm_eval.c	(revision 52786)
+++ ruby_2_2/vm_eval.c	(revision 52787)
@@ -2037,7 +2037,7 @@ local_var_list_update(st_data_t *key, st https://github.com/ruby/ruby/blob/trunk/ruby_2_2/vm_eval.c#L2037
 static void
 local_var_list_add(const struct local_var_list *vars, ID lid)
 {
-    if (lid && rb_id2str(lid)) {
+    if (lid && rb_is_local_id(lid)) {
 	/* should skip temporary variable */
 	st_table *tbl = RHASH_TBL_RAW(vars->tbl);
 	st_data_t idx = 0;	/* tbl->num_entries */
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 52786)
+++ ruby_2_2/version.h	(revision 52787)
@@ -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-29"
-#define RUBY_PATCHLEVEL 212
+#define RUBY_PATCHLEVEL 213
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 11
Index: ruby_2_2/test/ruby/test_variable.rb
===================================================================
--- ruby_2_2/test/ruby/test_variable.rb	(revision 52786)
+++ ruby_2_2/test/ruby/test_variable.rb	(revision 52787)
@@ -118,4 +118,15 @@ class TestVariable < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_variable.rb#L118
       }
     }
   end
+
+  def test_local_variables_with_kwarg
+    bug11674 = '[ruby-core:71437] [Bug #11674]'
+    v = with_kwargs_11(v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8,v9:9,v10:10,v11:11)
+    assert_equal(%i(v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11), v, bug11674)
+  end
+
+  private
+  def with_kwargs_11(v1:, v2:, v3:, v4:, v5:, v6:, v7:, v8:, v9:, v10:, v11:)
+    local_variables
+  end
 end

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


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

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