This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add File::Temp's OO test.
[perl5.git] / pp_hot.c
index 04442c9..8b31f0b 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2328,10 +2328,10 @@ PP(pp_leavesub)
     }
     PUTBACK;
 
-    LEAVE;
     POPSUB(cx,sv);     /* Stack values are safe: release CV and @_ ... */
     PL_curpm = newpm;  /* ... and pop $1 et al */
 
+    LEAVE;
     LEAVESUB(sv);
     return pop_return();
 }
@@ -2384,9 +2384,9 @@ PP(pp_leavesublv)
         * the refcounts so the caller gets a live guy. Cannot set
         * TEMP, so sv_2mortal is out of question. */
        if (!CvLVALUE(cx->blk_sub.cv)) {
-           LEAVE;
            POPSUB(cx,sv);
            PL_curpm = newpm;
+           LEAVE;
            LEAVESUB(sv);
            DIE(aTHX_ "Can't modify non-lvalue subroutine call");
        }
@@ -2395,9 +2395,9 @@ PP(pp_leavesublv)
            EXTEND_MORTAL(1);
            if (MARK == SP) {
                if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
-                   LEAVE;
                    POPSUB(cx,sv);
                    PL_curpm = newpm;
+                   LEAVE;
                    LEAVESUB(sv);
                    DIE(aTHX_ "Can't return %s from lvalue subroutine",
                        SvREADONLY(TOPs) ? (TOPs == &PL_sv_undef) ? "undef"
@@ -2410,9 +2410,9 @@ PP(pp_leavesublv)
                }
            }
            else {                      /* Should not happen? */
-               LEAVE;
                POPSUB(cx,sv);
                PL_curpm = newpm;
+               LEAVE;
                LEAVESUB(sv);
                DIE(aTHX_ "%s returned from lvalue subroutine in scalar context",
                    (MARK > SP ? "Empty array" : "Array"));
@@ -2426,9 +2426,9 @@ PP(pp_leavesublv)
                    && SvFLAGS(*mark) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
                    /* Might be flattened array after $#array =  */
                    PUTBACK;
-                   LEAVE;
                    POPSUB(cx,sv);
                    PL_curpm = newpm;
+                   LEAVE;
                    LEAVESUB(sv);
                    DIE(aTHX_ "Can't return a %s from lvalue subroutine",
                        SvREADONLY(TOPs) ? "readonly value" : "temporary");
@@ -2480,10 +2480,10 @@ PP(pp_leavesublv)
     }
     PUTBACK;
 
-    LEAVE;
     POPSUB(cx,sv);     /* Stack values are safe: release CV and @_ ... */
     PL_curpm = newpm;  /* ... and pop $1 et al */
 
+    LEAVE;
     LEAVESUB(sv);
     return pop_return();
 }