diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-16 00:16:46 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-16 00:16:46 +0000 |
| commit | 622e0fcc9a05b67f2d3e150f1bb92993c482e587 (patch) | |
| tree | 756ff7c3c7b9c9ca9e2fbdc505e228ebb7f0a624 | |
| parent | c73e8506c487c0c72db86f7c9eea332551d6a11e (diff) | |
| download | ruby-622e0fcc9a05b67f2d3e150f1bb92993c482e587.tar.gz ruby-622e0fcc9a05b67f2d3e150f1bb92993c482e587.tar.xz ruby-622e0fcc9a05b67f2d3e150f1bb92993c482e587.zip | |
* parse.y (block_call): block should not be given to yield.
[ruby-core:20583]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | parse.y | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Dec 16 09:14:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * parse.y (block_call): block should not be given to yield. + [ruby-core:20583] + Mon Dec 15 23:48:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * thread.c (sleep_timeval): cast tv_usec to long to shut up @@ -3497,7 +3497,12 @@ do_block : keyword_do_block 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); |
