From: Gurusamy Sarathy Date: Fri, 8 May 1998 19:33:44 +0000 (-0400) Subject: [win32] protect sortcop from C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0abe6c5e0e0a4db696c20e9f839d4a8ecaf4b54;p=p5sagit%2Fp5-mst-13.2.git [win32] protect sortcop from C Message-Id: <199805082333.TAA06287@aatma.engin.umich.edu> Subject: [PATCH] Re: double recursion in sort p4raw-id: //depot/win32/perl@918 --- diff --git a/pp_ctl.c b/pp_ctl.c index c203126..f54bb75 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; } diff --git a/t/op/runlevel.t b/t/op/runlevel.t index b5e5dbb..bff26e4 100755 --- a/t/op/runlevel.t +++ b/t/op/runlevel.t @@ -188,6 +188,8 @@ sub sortfn { print "---- ".join(', ', @x)."\n"; EXPECT sortfn 4, 5, 6 +sortfn 4, 5, 6 +sortfn 4, 5, 6 ---- 1, 2, 3 ######## @a = (3, 2, 1);