From c2052b027c8e4c8e95bb34e93b2e745a79eaaceb Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 15 Jan 2018 06:25:42 +0000 Subject: parse.y: Fix a bug of `obj[42, &blk] ||= foo bar` Follow up of r28123 (!) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 3eee213aab..3fa862d56b 100644 --- a/parse.y +++ b/parse.y @@ -1298,7 +1298,12 @@ command_asgn : lhs '=' command_rhs value_expr($6); $3 = make_array($3, &@3); - args = arg_concat(p, $3, $6, &@$); + if (nd_type($3) == NODE_BLOCK_PASS) { + args = NEW_ARGSCAT($3, $6, &@$); + } + else { + args = arg_concat(p, $3, $6, &@$); + } $$ = NEW_OP_ASGN1($1, $5, args, &@$); fixpos($$, $1); /*% -- cgit v1.2.3