summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2024-07-20 16:20:47 +0900
committerYuichiro Kaneko <[email protected]>2024-07-21 11:02:38 +0900
commit11e5ebaba7340ab09f26686d17ce196facc251f7 (patch)
tree56516f9a8ac37ed3c660cc4f3ad3a2f0a8189b2e /parse.y
parente7dda086170a5eaa037ddd5ebfcdc3aade15a26d (diff)
Fix SEGV on method call with empty args and brace block for do block command call
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11215
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 29e9ce0555..847e13e4da 100644
--- a/parse.y
+++ b/parse.y
@@ -5286,7 +5286,7 @@ block_call : command do_block
| block_call call_op2 operation2 opt_paren_args brace_block
{
bool has_args = $5 != 0;
- if (NODE_EMPTY_ARGS_P($5)) $5 = 0;
+ if (NODE_EMPTY_ARGS_P($4)) $4 = 0;
$$ = new_command_qcall(p, $2, $1, $3, $4, $5, &@3, &@$);
/*% ripper: command_call!($:1, $:2, $:3, $:4) %*/
if (has_args) {