more valgrinding: select problem?
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 55ec3c3..3c08f22 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -676,6 +676,7 @@ PP(pp_formline)
                    s++;
            }
            sv_chop(sv,s);
+           SvSETMAGIC(sv);
            break;
 
        case FF_LINEGLOB:
@@ -1730,6 +1731,11 @@ PP(pp_enteriter)
     SAVETMPS;
 
     if (PL_op->op_targ) {
+       if (PL_op->op_private & OPpLVAL_INTRO) { /* for my $x (...) */
+           SvPADSTALE_off(PAD_SVl(PL_op->op_targ));
+           SAVESETSVFLAGS(PAD_SVl(PL_op->op_targ),
+                   SVs_PADSTALE, SVs_PADSTALE);
+       }
 #ifndef USE_ITHREADS
        svp = &PAD_SVl(PL_op->op_targ);         /* "my" variable */
        SAVESPTR(*svp);
@@ -1936,7 +1942,6 @@ PP(pp_return)
     }
     PL_stack_sp = newsp;
 
-    LEAVE;
     /* Stack values are safe: */
     if (popsub2) {
        POPSUB(cx,sv);  /* release CV and @_ ... */
@@ -1945,6 +1950,7 @@ PP(pp_return)
        sv = Nullsv;
     PL_curpm = newpm;  /* ... and pop $1 et al */
 
+    LEAVE;
     LEAVESUB(sv);
     if (clear_errsv)
        sv_setpv(ERRSV,"");
@@ -2020,7 +2026,6 @@ PP(pp_last)
     SP = newsp;
     PUTBACK;
 
-    LEAVE;
     /* Stack values are safe: */
     switch (pop2) {
     case CXt_LOOP:
@@ -2033,6 +2038,7 @@ PP(pp_last)
     }
     PL_curpm = newpm;  /* ... and pop $1 et al */
 
+    LEAVE;
     LEAVESUB(sv);
     return nextop;
 }