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

ruby-changes:9285

From: yugui <ko1@a...>
Date: Wed, 17 Dec 2008 15:17:34 +0900 (JST)
Subject: [ruby-changes:9285] Ruby:r20823 (ruby_1_9_1): merges r20770 from trunk into ruby_1_9_1.

yugui	2008-12-17 15:17:11 +0900 (Wed, 17 Dec 2008)

  New Revision: 20823

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

  Log:
    merges r20770 from trunk into ruby_1_9_1.
    * parse.y (block_call): block should not be given to yield.
      [ruby-core:20583]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/parse.y

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20822)
+++ ruby_1_9_1/ChangeLog	(revision 20823)
@@ -1,3 +1,8 @@
+Tue Dec 16 09:14:28 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* parse.y (block_call): block should not be given to yield.
+	  [ruby-core:20583]
+
 Mon Dec 15 23:48:39 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* thread.c (sleep_timeval): cast tv_usec to long to shut up
Index: ruby_1_9_1/parse.y
===================================================================
--- ruby_1_9_1/parse.y	(revision 20822)
+++ ruby_1_9_1/parse.y	(revision 20823)
@@ -3497,7 +3497,12 @@
 block_call	: command do_block
 		    {
 		    /*%%%*/
-			block_dup_check($1->nd_args, $2);
+			if (nd_type($1) == NODE_YIELD) {
+			    compile_error(PARSER_ARG "block given to yield");
+			}
+			else {
+			    block_dup_check($1->nd_args, $2);
+			}    
 			$2->nd_iter = $1;
 			$$ = $2;
 			fixpos($$, $1);

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

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