const I32 oldscopeix = PL_scopestack_ix;
I32 result;
PMOP * const pm = PL_curpm;
+ OP * const sortop = PL_op;
PERL_ARGS_ASSERT_SORTCV;
CALLRUNOPS(aTHX);
if (PL_stack_sp != PL_stack_base + 1)
Perl_croak(aTHX_ "Sort subroutine didn't return single value");
+ PL_op = sortop;
result = SvIV(*PL_stack_sp);
while (PL_scopestack_ix > oldscopeix) {
LEAVE;
I32 result;
AV * const av = GvAV(PL_defgv);
PMOP * const pm = PL_curpm;
+ OP * const sortop = PL_op;
PERL_ARGS_ASSERT_SORTCV_STACKED;
CALLRUNOPS(aTHX);
if (PL_stack_sp != PL_stack_base + 1)
Perl_croak(aTHX_ "Sort subroutine didn't return single value");
+ PL_op = sortop;
result = SvIV(*PL_stack_sp);
while (PL_scopestack_ix > oldscopeix) {
LEAVE;
@sort = sort {$a <=> $b} $m1, $g1;
sub sortf {$a-1 <=> $b-1};
@sort = sort &sortf, $m1, $g1;
+@sort = sort { undef } 1, 2;
+sub frobnicate($$) { undef }
+@sort = sort frobnicate 1, 2;
EXPECT
Use of uninitialized value $m1 in sort at - line 6.
Use of uninitialized value $g1 in sort at - line 6.
Use of uninitialized value $m1 in sort at - line 9.
Use of uninitialized value $g1 in sort at - line 9.
Use of uninitialized value $g1 in sort at - line 9.
+Use of uninitialized value in sort at - line 10.
+Use of uninitialized value in sort at - line 11.
########
use warnings 'uninitialized';
my ($m1, $m2, $v);