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

ruby-changes:32658

From: usa <ko1@a...>
Date: Wed, 29 Jan 2014 12:55:39 +0900 (JST)
Subject: [ruby-changes:32658] usa:r44737 (ruby_1_9_3): merge revision(s) 44449: [Backport #9308]

usa	2014-01-29 12:55:32 +0900 (Wed, 29 Jan 2014)

  New Revision: 44737

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

  Log:
    merge revision(s) 44449: [Backport #9308]
    
    * parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
      isolate command argument state from outer scope.
      [ruby-core:59342] [Bug #9308]

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/parse.y
    branches/ruby_1_9_3/test/ruby/test_syntax.rb
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 44736)
+++ ruby_1_9_3/ChangeLog	(revision 44737)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Wed Jan 29 12:54:13 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
+	  isolate command argument state from outer scope.
+	  [ruby-core:59342] [Bug #9308]
+
 Wed Jan 29 12:37:33 2014  Koichi Sasada  <ko1@a...>
 
 	* vm.c (rb_thread_mark): mark a working Proc of bmethod
Index: ruby_1_9_3/parse.y
===================================================================
--- ruby_1_9_3/parse.y	(revision 44736)
+++ ruby_1_9_3/parse.y	(revision 44737)
@@ -102,6 +102,7 @@ struct local_vars { https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/parse.y#L102
     struct vtable *vars;
     struct vtable *used;
     struct local_vars *prev;
+    stack_type cmdargs;
 };
 
 #define DVARS_INHERIT ((void*)1)
@@ -9195,6 +9196,8 @@ local_push_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/parse.y#L9196
     local->args = vtable_alloc(0);
     local->vars = vtable_alloc(inherit_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
     local->used = !inherit_dvars && RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
+    local->cmdargs = cmdarg_stack;
+    cmdarg_stack = 0;
     lvtbl = local;
 }
 
@@ -9208,6 +9211,7 @@ local_pop_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/parse.y#L9211
     }
     vtable_free(lvtbl->args);
     vtable_free(lvtbl->vars);
+    cmdarg_stack = lvtbl->cmdargs;
     xfree(lvtbl);
     lvtbl = local;
 }
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 44736)
+++ ruby_1_9_3/version.h	(revision 44737)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 491
+#define RUBY_PATCHLEVEL 492
 
 #define RUBY_RELEASE_DATE "2014-01-29"
 #define RUBY_RELEASE_YEAR 2014
Index: ruby_1_9_3/test/ruby/test_syntax.rb
===================================================================
--- ruby_1_9_3/test/ruby/test_syntax.rb	(revision 44736)
+++ ruby_1_9_3/test/ruby/test_syntax.rb	(revision 44737)
@@ -55,6 +55,11 @@ class TestSyntax < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/ruby/test_syntax.rb#L55
     f.close!
   end
 
+  def test_do_block_in_call_args
+    bug9308 = '[ruby-core:59342] [Bug #9308]'
+    assert_valid_syntax("bar def foo; self.each do end end", bug9308)
+  end
+
   def test_reserved_method_no_args
     bug6403 = '[ruby-dev:45626]'
     assert_valid_syntax("def self; :foo; end", __FILE__, bug6403)

Property changes on: ruby_1_9_3/test/ruby/test_syntax.rb
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk/test/ruby/test_syntax.rb:r44449


Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44449


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

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