File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2546,7 +2546,10 @@ PP(pp_next)
2546
2546
{
2547
2547
PERL_CONTEXT * cx ;
2548
2548
2549
- cx = S_unwind_loop (aTHX );
2549
+ /* if not a bare 'next' in the main scope, search for it */
2550
+ cx = CX_CUR ();
2551
+ if (!((PL_op -> op_flags & OPf_SPECIAL ) && CxTYPE_is_LOOP (cx )))
2552
+ cx = S_unwind_loop (aTHX );
2550
2553
2551
2554
TOPBLOCK (cx );
2552
2555
PL_curcop = cx -> blk_oldcop ;
Original file line number Diff line number Diff line change 1030
1030
code => ' for (@a) {}' ,
1031
1031
},
1032
1032
1033
+ ' loop::for::next4' => {
1034
+ desc => ' for loop containing only next with my var and integer 4 array' ,
1035
+ setup => ' my @a = (1..4);' ,
1036
+ code => ' for my $x (@a) {next}' ,
1037
+ },
1038
+
1033
1039
' loop::while::i1' => {
1034
1040
desc => ' empty while loop 1 iteration' ,
1035
1041
setup => ' my $i = 0;' ,
You can’t perform that action at this time.
0 commit comments