File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5898,6 +5898,7 @@ PP(pp_reverse)
5898
5898
sv_setsv (TARG , DEFSV );
5899
5899
XPUSHs (TARG );
5900
5900
}
5901
+ SvSETMAGIC (TARG ); /* remove any utf8 length magic */
5901
5902
5902
5903
up = SvPV_force (TARG , len );
5903
5904
if (len > 1 ) {
Original file line number Diff line number Diff line change 6
6
set_up_inc(' ../lib' );
7
7
}
8
8
9
- plan tests => 24 ;
9
+ plan tests => 25 ;
10
10
11
11
is(reverse (" abc" ), " cba" , ' simple reverse' );
12
12
@@ -92,6 +92,15 @@ use Tie::Array;
92
92
is($a , $c , ' Unicode string double reversal matches original' );
93
93
}
94
94
95
+ {
96
+ # https://github.com/Perl/perl5/issues/17737
97
+ # utf8 length magic handling
98
+ # threw an assertion failure with -DDEBUGGING
99
+ my @x ;
100
+ push @x , length reverse for split " -" , " \x{100} --0" ;
101
+ is($x [1], 0, " check set magic being called to clear length magic" );
102
+ }
103
+
95
104
# [perl #132544] stack pointer used to go wild when nullary reverse
96
105
# required extending the stack
97
106
for (0..1000){()=(0..$_ ,scalar reverse )}
You can’t perform that action at this time.
0 commit comments