Skip to content

Commit

Permalink
Check not in block. Fixes rubinius#1692
Browse files Browse the repository at this point in the history
  • Loading branch information
IPGlider committed Aug 9, 2012
1 parent 05cc511 commit d4b6901
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ext/melbourne/grammar19.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8057,7 +8057,7 @@ int yynerrs;
{
if(!is_local_id((yyvsp[(2) - (2)].id)))
yy_error("block argument must be local variable");
else if(local_id((yyvsp[(2) - (2)].id)))
else if(!in_block() && local_id((yyvsp[(2) - (2)].id)))
yy_error("duplicate block argument name");
arg_var(shadowing_lvar(get_id((yyvsp[(2) - (2)].id))));
(yyval.id) = (yyvsp[(2) - (2)].id);
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/melbourne/grammar19.y
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ f_block_arg : blkarg_mark tIDENTIFIER
{
if(!is_local_id($2))
yy_error("block argument must be local variable");
else if(local_id($2))
else if(!in_block() && local_id($2))
yy_error("duplicate block argument name");
arg_var(shadowing_lvar(get_id($2)));
$$ = $2;
Expand Down

0 comments on commit d4b6901

Please sign in to comment.