summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2022-10-08 18:53:41 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2022-10-08 22:30:50 +0900
commit50f5223236704c75c827d0a745fc934ad9c86277 (patch)
treecef8bef0382c4950bfc4b0552eabc8e9b6877cb1 /parse.y
parent0f231f2babf314593bcd233f4f5b8de8dc936145 (diff)
downloadruby-50f5223236704c75c827d0a745fc934ad9c86277.tar.gz
Fix SEGV of dump parsetree
Assign internal_id to semantic value so that dump parsetree option can render the tree for these codes without SEGV. * `def m(&); end` * `def m(*); end` * `def m(**); end`
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 7d830c2255..8f3bca0873 100644
--- a/parse.y
+++ b/parse.y
@@ -5602,6 +5602,7 @@ f_kwrest : kwrest_mark tIDENTIFIER
{
arg_var(p, ANON_KEYWORD_REST_ID);
/*%%%*/
+ $$ = internal_id(p);
/*% %*/
/*% ripper: kwrest_param!(Qnil) %*/
}
@@ -5677,6 +5678,7 @@ f_rest_arg : restarg_mark tIDENTIFIER
{
arg_var(p, ANON_REST_ID);
/*%%%*/
+ $$ = internal_id(p);
/*% %*/
/*% ripper: rest_param!(Qnil) %*/
}
@@ -5698,6 +5700,7 @@ f_block_arg : blkarg_mark tIDENTIFIER
{
arg_var(p, ANON_BLOCK_ID);
/*%%%*/
+ $$ = internal_id(p);
/*% %*/
/*% ripper: blockarg!(Qnil) %*/
}