summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-07-11 13:58:47 +0100
committerDavid Mitchell <davem@iabyn.com>2016-02-03 08:59:36 +0000
commit486430a5ae61ba02ab78cb71719b0fac0c47fb52 (patch)
tree1ddc6d631caa0370ededf12809129a65e8f15480 /pp_sort.c
parent80774f050c0c69194a7d501e38566ff35690833b (diff)
downloadperl-486430a5ae61ba02ab78cb71719b0fac0c47fb52.tar.gz
pp_sort: move SAVETMPS later
Move the SAVETMPS to just after the PUSHSUB. This should make no functional difference, because nothing should have affected the TMPS stack between the old and the new code positions. For the OPf_SPECIAL/ CXt_NULL case, which doesn't do a PUSHSUB, do another SAVETMPS there too.
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_sort.c b/pp_sort.c
index 1e48042a9f..df4c05f1af 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1643,7 +1643,6 @@ PP(pp_sort)
SV** newsp;
const bool oldcatch = CATCH_GET;
- SAVETMPS;
SAVEOP();
CATCH_SET(TRUE);
@@ -1673,6 +1672,7 @@ PP(pp_sort)
if (!(flags & OPf_SPECIAL)) {
cx->cx_type = CXt_SUB;
PUSHSUB(cx);
+ SAVETMPS;
if (!is_xsub) {
PADLIST * const padlist = CvPADLIST(cv);
@@ -1692,6 +1692,9 @@ PP(pp_sort)
}
}
+ else
+ SAVETMPS;
+
cx->cx_type |= CXp_MULTICALL;
start = p1 - max;