summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-08 15:33:44 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-05-09 17:09:09 +0000
commitd0abe6c5e0e0a4db696c20e9f839d4a8ecaf4b54 (patch)
treed6ba9184f1d95c8947eafccef6411ddccf3677af /pp_ctl.c
parent75d58f20e1bcf22f3c51136478cfb257de1483f6 (diff)
downloadperl-d0abe6c5e0e0a4db696c20e9f839d4a8ecaf4b54.tar.gz
[win32] protect sortcop from C<sort { sort { ... } ... } ...>
Message-Id: <199805082333.TAA06287@aatma.engin.umich.edu> Subject: [PATCH] Re: double recursion in sort p4raw-id: //depot/win32/perl@918
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index c20312639f..f54bb75291 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -652,8 +652,9 @@ PP(pp_sort)
RETPUSHUNDEF;
}
+ ENTER;
+ SAVEPPTR(sortcop);
if (op->op_flags & OPf_STACKED) {
- ENTER;
if (op->op_flags & OPf_SPECIAL) {
OP *kid = cLISTOP->op_first->op_sibling; /* pass pushmark */
kid = kUNOP->op_first; /* pass rv2gv */
@@ -740,7 +741,6 @@ PP(pp_sort)
POPSTACK();
CATCH_SET(oldcatch);
}
- LEAVE;
}
else {
if (max > 1) {
@@ -749,6 +749,7 @@ PP(pp_sort)
(op->op_private & OPpLOCALE) ? sv_cmp_locale : sv_cmp);
}
}
+ LEAVE;
stack_sp = ORIGMARK + max;
return nextop;
}