@@ -1307,7 +1307,7 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
13071307
13081308 iseq -> body -> param .flags .has_kw = TRUE;
13091309 iseq -> body -> param .keyword = keyword = ZALLOC_N (struct rb_iseq_param_keyword , 1 );
1310- keyword -> bits_start = get_dyna_var_idx_at_raw (iseq , args -> kw_rest_arg -> nd_vid );
1310+ keyword -> bits_start = get_dyna_var_idx_at_raw (iseq , args -> kw_rest_arg -> nd_cflag );
13111311
13121312 while (node ) {
13131313 NODE * val_node = node -> nd_body -> nd_value ;
@@ -1346,8 +1346,8 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
13461346
13471347 keyword -> num = kw ;
13481348
1349- if (args -> kw_rest_arg -> nd_cflag != 0 ) {
1350- keyword -> rest_start = get_dyna_var_idx_at_raw (iseq , args -> kw_rest_arg -> nd_cflag );
1349+ if (args -> kw_rest_arg -> nd_vid != 0 ) {
1350+ keyword -> rest_start = get_dyna_var_idx_at_raw (iseq , args -> kw_rest_arg -> nd_vid );
13511351 iseq -> body -> param .flags .has_kwrest = TRUE;
13521352 }
13531353 keyword -> required_num = rkw ;
@@ -5037,8 +5037,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
50375037 ADD_INSN1 (ret , line , topn , INT2FIX (1 ));
50385038 }
50395039 ADD_SEND_WITH_FLAG (ret , line , aid , INT2FIX (1 ), INT2FIX (asgnflag ));
5040+ if (lskip && popped ) {
5041+ ADD_LABEL (ret , lskip );
5042+ }
50405043 ADD_INSN (ret , line , pop );
5041- if (lskip ) {
5044+ if (lskip && ! popped ) {
50425045 ADD_LABEL (ret , lskip );
50435046 }
50445047 }
@@ -5357,7 +5360,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
53575360 if (liseq -> body -> param .flags .has_rest ) {
53585361 /* rest argument */
53595362 int idx = liseq -> body -> local_table_size - liseq -> body -> param .rest_start ;
5363+
53605364 ADD_GETLOCAL (args , line , idx , lvar_level );
5365+ ADD_INSN1 (args , line , splatarray , Qfalse );
53615366
53625367 argc = liseq -> body -> param .rest_start + 1 ;
53635368 flag |= VM_CALL_ARGS_SPLAT ;
@@ -6295,14 +6300,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
62956300 }
62966301 case NODE_PRELUDE :{
62976302 const rb_compile_option_t * orig_opt = ISEQ_COMPILE_DATA (iseq )-> option ;
6303+ VALUE orig_cov = ISEQ_COVERAGE (iseq );
6304+ rb_compile_option_t new_opt = * orig_opt ;
62986305 if (node -> nd_orig ) {
6299- rb_compile_option_t new_opt = * orig_opt ;
63006306 rb_iseq_make_compile_option (& new_opt , node -> nd_orig );
63016307 ISEQ_COMPILE_DATA (iseq )-> option = & new_opt ;
63026308 }
6309+ if (!new_opt .coverage_enabled ) ISEQ_COVERAGE_SET (iseq , Qfalse );
63036310 CHECK (COMPILE_POPPED (ret , "prelude" , node -> nd_head ));
63046311 CHECK (COMPILE_ (ret , "body" , node -> nd_body , popped ));
63056312 ISEQ_COMPILE_DATA (iseq )-> option = orig_opt ;
6313+ ISEQ_COVERAGE_SET (iseq , orig_cov );
63066314 break ;
63076315 }
63086316 case NODE_LAMBDA :{
0 commit comments