* parse.y (block_call): block should not be given to yield.

[ruby-core:20583]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-12-16 00:16:46 +00:00
parent c6f32ff88b
commit 587afe728b
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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);