diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-02 03:05:06 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-02 03:05:06 +0000 |
commit | 276fb7e77b20b33f099a11c89e94388ffe3ae40d (patch) | |
tree | 5ce3ee11ca1be8499372e153635241f096af355b /parse.y | |
parent | 4c897fdde1fe20918a6577765b77c7d091a5ee98 (diff) |
* compile.c (iseq_compile_each): should consider block on stack,
if block argument is passed. [ruby-core:30534]
* parse.c (arg_concat_gen): should append to nd_head, not to
nd_iter for NODE_BLOCK_PASS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1953,7 +1953,12 @@ arg : lhs '=' arg value_expr($6); if (!$3) $3 = NEW_ZARRAY(); - args = arg_concat($3, $6); + if (nd_type($3) == NODE_BLOCK_PASS) { + args = NEW_ARGSCAT($3, $6); + } + else { + args = arg_concat($3, $6); + } if ($5 == tOROP) { $5 = 0; } @@ -8309,7 +8314,10 @@ arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2) if (!node2) return node1; switch (nd_type(node1)) { case NODE_BLOCK_PASS: - node1->nd_iter = arg_concat(node1->nd_iter, node2); + if (node1->nd_head) + node1->nd_head = arg_concat(node1->nd_head, node2); + else + node1->nd_head = NEW_LIST(node2); return node1; case NODE_ARGSPUSH: if (nd_type(node2) != NODE_ARRAY) break; |