@@ -2147,6 +2147,17 @@ rb_eval_string_wrap(const char *str, int *pstate)
21472147
21482148VALUE
21492149rb_eval_cmd_kw (VALUE cmd , VALUE arg , int kw_splat )
2150+ {
2151+ Check_Type (arg , T_ARRAY );
2152+ int argc = RARRAY_LENINT (arg );
2153+ const VALUE * argv = RARRAY_CONST_PTR (arg );
2154+ VALUE val = rb_eval_cmd_call_kw (cmd , argc , argv , kw_splat );
2155+ RB_GC_GUARD (arg );
2156+ return val ;
2157+ }
2158+
2159+ VALUE
2160+ rb_eval_cmd_call_kw (VALUE cmd , int argc , const VALUE * argv , int kw_splat )
21502161{
21512162 enum ruby_tag_type state ;
21522163 volatile VALUE val = Qnil ; /* OK */
@@ -2155,8 +2166,7 @@ rb_eval_cmd_kw(VALUE cmd, VALUE arg, int kw_splat)
21552166 EC_PUSH_TAG (ec );
21562167 if ((state = EC_EXEC_TAG ()) == TAG_NONE ) {
21572168 if (!RB_TYPE_P (cmd , T_STRING )) {
2158- val = rb_funcallv_kw (cmd , idCall , RARRAY_LENINT (arg ),
2159- RARRAY_CONST_PTR (arg ), kw_splat );
2169+ val = rb_funcallv_kw (cmd , idCall , argc , argv , kw_splat );
21602170 }
21612171 else {
21622172 val = eval_string_with_cref (rb_vm_top_self (), cmd , NULL , 0 , 0 );
0 commit comments