summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-21 08:08:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-21 08:08:36 +0000
commit2ca2a4a43bb018bfd84fccc75e395c1f0e58acc6 (patch)
tree60b46bd4507018b7c53ba2702d11119699c92779 /parse.y
parentad5f0fc6ccba716676a40c0a635fd41a8a782d4a (diff)
* parse.y (block_param): do not use multiple assignment for a sole
block parameter. [ruby-dev:28710] * eval.c (rb_yield_0): pass a raw yielded value to a sole block parameter if a value is passed by yield. * eval.c (proc_invoke): args may not be an array. * eval.c (rb_proc_yield): pass original value without wrapping it in an array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 3af47099ff..53b4df983a 100644
--- a/parse.y
+++ b/parse.y
@@ -2900,7 +2900,13 @@ block_param0 : mlhs_item
block_param : block_param0
{
/*%%%*/
- $$ = NEW_MASGN($1, 0);
+ if ($1->nd_alen == 1) {
+ $$ = $1->nd_head;
+ rb_gc_force_recycle((VALUE)$1);
+ }
+ else {
+ $$ = NEW_MASGN($1, 0);
+ }
/*%
$$ = blockvar_new($1);
%*/