summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-12 20:28:21 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-12 23:28:30 -0700
commitd4c6760ad383a9419aef88be3abd479ebcfb6d36 (patch)
tree8e3c8e8433a320c12ecb90efcb57abadd8f82f95 /pp_sort.c
parent1bd4e8e3299afcce93457b0dd2e33e3c7c466c98 (diff)
downloadperl-d4c6760ad383a9419aef88be3abd479ebcfb6d36.tar.gz
Mention sort in warnings about sort sub retvals
With this commit, $ ./miniperl -we '()=sort { undef } 1,2' Use of uninitialized value at -e line 1. becomes $ ./miniperl -we '()=sort { undef } 1,2' Use of uninitialized value in sort at -e line 1.
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pp_sort.c b/pp_sort.c
index 8dacd74a20..fafa00acf2 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1764,6 +1764,7 @@ S_sortcv(pTHX_ SV *const a, SV *const b)
const I32 oldscopeix = PL_scopestack_ix;
I32 result;
PMOP * const pm = PL_curpm;
+ OP * const sortop = PL_op;
PERL_ARGS_ASSERT_SORTCV;
@@ -1774,6 +1775,7 @@ S_sortcv(pTHX_ SV *const a, SV *const b)
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;
@@ -1792,6 +1794,7 @@ S_sortcv_stacked(pTHX_ SV *const a, SV *const b)
I32 result;
AV * const av = GvAV(PL_defgv);
PMOP * const pm = PL_curpm;
+ OP * const sortop = PL_op;
PERL_ARGS_ASSERT_SORTCV_STACKED;
@@ -1822,6 +1825,7 @@ S_sortcv_stacked(pTHX_ SV *const a, SV *const b)
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;