I32 result;
PMOP * const pm = PL_curpm;
OP * const sortop = PL_op;
+ COP * const cop = PL_curcop;
SV **pad;
PERL_ARGS_ASSERT_SORTCV;
if (PL_stack_sp != PL_stack_base + 1)
Perl_croak(aTHX_ "Sort subroutine didn't return single value");
PL_op = sortop;
+ PL_curcop = cop;
pad = PL_curpad; PL_curpad = 0;
result = SvIV(*PL_stack_sp);
PL_curpad = pad;
AV * const av = GvAV(PL_defgv);
PMOP * const pm = PL_curpm;
OP * const sortop = PL_op;
+ COP * const cop = PL_curcop;
SV **pad;
PERL_ARGS_ASSERT_SORTCV_STACKED;
if (PL_stack_sp != PL_stack_base + 1)
Perl_croak(aTHX_ "Sort subroutine didn't return single value");
PL_op = sortop;
+ PL_curcop = cop;
pad = PL_curpad; PL_curpad = 0;
result = SvIV(*PL_stack_sp);
PL_curpad = pad;
@sort = sort { undef } 1, 2;
sub frobnicate($$) { undef }
@sort = sort frobnicate 1, 2;
+@sort = sort pyfg 1, 2;
+@sort = sort pyfgc 1, 2;
+no warnings;
+sub pyfg { undef }
+sub pyfgc($$) { undef }
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 $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 of uninitialized value in sort at - line 12.
+Use of uninitialized value in sort at - line 13.
+Use of uninitialized value in sort at - line 14.
########
my $nan = sin 9**9**9;
if ($nan == $nan) {