In pp_subst, rxtainted is not a boolean, as it stores 2 bits of values.
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index f543372..03eeb71 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -731,6 +731,11 @@ PP(pp_print)
        *MARK = SvTIED_obj((SV*)io, mg);
        PUTBACK;
        ENTER;
+       if( PL_op->op_type == OP_SAY ) {
+               /* local $\ = "\n" */
+               SAVEGENERICSV(PL_ors_sv);
+               PL_ors_sv = newSVpvs("\n");
+       }
        call_method("PRINT", G_SCALAR);
        LEAVE;
        SPAGAIN;
@@ -1192,7 +1197,7 @@ PP(pp_qr)
     dVAR; dSP;
     register PMOP * const pm = cPMOP;
     REGEXP * rx = PM_GETRE(pm);
-    SV * const pkg = CALLREG_PACKAGE(rx);
+    SV * const pkg = rx ? CALLREG_PACKAGE(rx) : NULL;
     SV * const rv = sv_newmortal();
 
     SvUPGRADE(rv, SVt_IV);
@@ -1956,6 +1961,15 @@ PP(pp_iter)
            *itersvp = newSViv(cx->blk_loop.iterix++);
            SvREFCNT_dec(oldsv);
        }
+
+       /* Handle end of range at IV_MAX */
+       if ((cx->blk_loop.iterix == IV_MIN) &&
+           (cx->blk_loop.itermax == IV_MAX))
+       {
+           cx->blk_loop.iterix++;
+           cx->blk_loop.itermax++;
+       }
+
        RETPUSHYES;
     }
 
@@ -2037,7 +2051,7 @@ PP(pp_subst)
     I32 maxiters;
     register I32 i;
     bool once;
-    bool rxtainted;
+    U8 rxtainted;
     char *orig;
     I32 r_flags;
     register REGEXP *rx = PM_GETRE(pm);
@@ -2491,7 +2505,7 @@ PP(pp_leavesublv)
 
     TAINT_NOT;
 
-    if (cx->blk_sub.lval & OPpENTERSUB_INARGS) {
+    if (CxLVAL(cx) & OPpENTERSUB_INARGS) {
        /* We are an argument to a function or grep().
         * This kind of lvalueness was legal before lvalue
         * subroutines too, so be backward compatible:
@@ -2518,7 +2532,7 @@ PP(pp_leavesublv)
            }
        }
     }
-    else if (cx->blk_sub.lval) {     /* Leave it as it is if we can. */
+    else if (CxLVAL(cx)) {     /* Leave it as it is if we can. */
        /* Here we go for robustness, not for speed, so we change all
         * the refcounts so the caller gets a live guy. Cannot set
         * TEMP, so sv_2mortal is out of question. */
@@ -2816,7 +2830,7 @@ try_autoload:
         * stuff so that __WARN__ handlers can safely dounwind()
         * if they want to
         */
-       if (CvDEPTH(cv) == 100 && ckWARN(WARN_RECURSION)
+       if (CvDEPTH(cv) == PERL_SUB_DEPTH_WARN && ckWARN(WARN_RECURSION)
            && !(PERLDB_SUB && cv == GvCV(PL_DBsub)))
            sub_crush_depth(cv);
 #if 0