PERL_ARGS_ASSERT_SORTCV_STACKED;
+ if (AvREAL(av)) {
+ av_clear(av);
+ AvREAL_off(av);
+ AvREIFY_on(av);
+ }
if (AvMAX(av) < 1) {
- SV** ary = AvALLOC(av);
+ SV **ary = AvALLOC(av);
if (AvARRAY(av) != ary) {
AvMAX(av) += AvARRAY(av) - AvALLOC(av);
AvARRAY(av) = ary;
AvMAX(av) = 1;
Renew(ary,2,SV*);
AvARRAY(av) = ary;
+ AvALLOC(av) = ary;
}
}
AvFILLp(av) = 1;
require 'test.pl';
}
use warnings;
-plan( tests => 151 );
+plan( tests => 153 );
# these shouldn't hang
{
is("@sorted","1 2", 'overload sort result');
is($cs, 2, 'overload string called twice');
}
+
+fresh_perl_is('sub w ($$) {my ($l, my $r) = @_; my $v = \@_; undef @_; $l <=> $r}; print join q{ }, sort w 3, 1, 2, 0',
+ '0 1 2 3',
+ {stderr => 1, switches => ['-w']},
+ 'RT #72334');
+
+fresh_perl_is('sub w ($$) {my ($l, my $r) = @_; my $v = \@_; undef @_; @_ = 0..2; $l <=> $r}; print join q{ }, sort w 3, 1, 2, 0',
+ '0 1 2 3',
+ {stderr => 1, switches => ['-w']},
+ 'RT #72334');