This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move and rename cx_old_savestack_ix
[perl5.git] / pp_sort.c
index 47d4a06..a95796d 100644 (file)
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1670,7 +1670,7 @@ PP(pp_sort)
             gimme = G_SCALAR;
            PUSHBLOCK(cx, CXt_NULL, PL_stack_base);
            if (!(flags & OPf_SPECIAL)) {
-               cx->cx_type = CXt_SUB;
+               cx->cx_type = CXt_SUB|CXp_MULTICALL;
                PUSHSUB(cx);
                if (!is_xsub) {
                    PADLIST * const padlist = CvPADLIST(cv);
@@ -1691,16 +1691,8 @@ PP(pp_sort)
 
                }
            }
-            else {
-                /* mimic PUSHSUB. Note that we're cheating and using a
-                 * CXt_NULL block as a CXt_SUB block */
-                cx->cx_u.cx_blk.blku_old_tmpsfloor = PL_tmps_floor;
-                PL_tmps_floor = PL_tmps_ix;
-            }
-            cx->cx_u.cx_blk.blku_old_savestack_ix = old_savestack_ix;
+            cx->blk_oldsaveix = old_savestack_ix;
 
-           cx->cx_type |= CXp_MULTICALL;
-           
            start = p1 - max;
            sortsvp(aTHX_ start, max,
                    (is_xsub ? S_sortcv_xsub : hasargs ? S_sortcv_stacked : S_sortcv),
@@ -1711,17 +1703,17 @@ PP(pp_sort)
 
            PL_stack_sp = PL_stack_base + cx->blk_oldsp;
 
+            CX_LEAVE_SCOPE(cx);
            if (!(flags & OPf_SPECIAL)) {
                 assert(CxTYPE(cx) == CXt_SUB);
                 POPSUB(cx);
            }
             else
                 assert(CxTYPE(cx) == CXt_NULL);
-                /* mimic POPSUB */
-                PL_tmps_floor = cx->cx_u.cx_blk.blku_old_tmpsfloor;
+                /* there isn't a POPNULL ! */
 
            POPBLOCK(cx);
-            cxstack_ix--;
+            CX_POP(cx);
            POPSTACK;
            CATCH_SET(oldcatch);
        }