ruby-changes:61707
From: Kazuki <ko1@a...>
Date: Sun, 14 Jun 2020 13:16:56 +0900 (JST)
Subject: [ruby-changes:61707] 97614c5521 (master): apinfo/fpinfo should always be non-NULL
https://git.ruby-lang.org/ruby.git/commit/?id=97614c5521 From 97614c55215afcc834c78aa27e34388cd0ca4c84 Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto <kazuki@c...> Date: Sun, 14 Jun 2020 13:06:42 +0900 Subject: apinfo/fpinfo should always be non-NULL diff --git a/parse.y b/parse.y index 2c8b1ab..c09c9f9 100644 --- a/parse.y +++ b/parse.y @@ -830,13 +830,11 @@ new_array_pattern(struct parser_params *p, VALUE constant, VALUE pre_arg, VALUE https://github.com/ruby/ruby/blob/trunk/parse.y#L830 { NODE *t = (NODE *)aryptn; struct rb_ary_pattern_info *apinfo = t->nd_apinfo; - VALUE pre_args = Qnil, rest_arg = Qnil, post_args = Qnil; + VALUE pre_args, rest_arg, post_args; - if (apinfo) { - pre_args = rb_ary_entry(apinfo->imemo, 0); - rest_arg = rb_ary_entry(apinfo->imemo, 1); - post_args = rb_ary_entry(apinfo->imemo, 2); - } + pre_args = rb_ary_entry(apinfo->imemo, 0); + rest_arg = rb_ary_entry(apinfo->imemo, 1); + post_args = rb_ary_entry(apinfo->imemo, 2); if (!NIL_P(pre_arg)) { if (!NIL_P(pre_args)) { @@ -878,13 +876,11 @@ new_find_pattern(struct parser_params *p, VALUE constant, VALUE fndptn, const YY https://github.com/ruby/ruby/blob/trunk/parse.y#L876 { NODE *t = (NODE *)fndptn; struct rb_fnd_pattern_info *fpinfo = t->nd_fpinfo; - VALUE pre_rest_arg = Qnil, args = Qnil, post_rest_arg = Qnil; + VALUE pre_rest_arg, args, post_rest_arg; - if (fpinfo) { - pre_rest_arg = rb_ary_entry(fpinfo->imemo, 0); - args = rb_ary_entry(fpinfo->imemo, 1); - post_rest_arg = rb_ary_entry(fpinfo->imemo, 2); - } + pre_rest_arg = rb_ary_entry(fpinfo->imemo, 0); + args = rb_ary_entry(fpinfo->imemo, 1); + post_rest_arg = rb_ary_entry(fpinfo->imemo, 2); return dispatch4(fndptn, constant, pre_rest_arg, args, post_rest_arg); } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/