avoid temp file littering in tests
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index c542cbf..daefb14 100644 (file)
--- a/op.c
+++ b/op.c
@@ -852,8 +852,14 @@ clear_pmop:
 #endif
        }
        cPMOPo->op_pmreplroot = Nullop;
-       ReREFCNT_dec(PM_GETRE(cPMOPo));
-       PM_SETRE(cPMOPo, (REGEXP*)NULL);
+        /* we use the "SAFE" version of the PM_ macros here
+         * since sv_clean_all might release some PMOPs
+         * after PL_regex_padav has been cleared
+         * and the clearing of PL_regex_padav needs to
+         * happen before sv_clean_all
+         */
+       ReREFCNT_dec(PM_GETRE_SAFE(cPMOPo));
+       PM_SETRE_SAFE(cPMOPo, (REGEXP*)NULL);
        break;
     }
 
@@ -2210,9 +2216,14 @@ Perl_localize(pTHX_ OP *o, I32 lex)
     if (o->op_flags & OPf_PARENS)
        list(o);
     else {
-       if (ckWARN(WARN_PARENTHESIS) && PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ',') {
-           char *s;
-           for (s = PL_bufptr; *s && (isALNUM(*s) || UTF8_IS_CONTINUED(*s) || strchr("@$%, ",*s)); s++) ;
+       if (ckWARN(WARN_PARENTHESIS)
+           && PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ',')
+       {
+           char *s = PL_bufptr;
+
+           while (*s && (isALNUM(*s) || UTF8_IS_CONTINUED(*s) || strchr("@$%, ", *s)))
+               s++;
+
            if (*s == ';' || *s == '=')
                Perl_warner(aTHX_ WARN_PARENTHESIS,
                            "Parentheses missing around \"%s\" list",
@@ -3220,7 +3231,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg)
     OP *imop;
     OP *veop;
     char *packname = Nullch;
-    STRLEN packlen;
+    STRLEN packlen = 0;
     SV *packsv;
 
     if (id->op_type != OP_CONST)
@@ -3279,7 +3290,10 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg)
                                   newSVOP(OP_METHOD_NAMED, 0, meth)));
     }
 
-    if (ckWARN(WARN_MISC) && imop && SvPOK(packsv = ((SVOP*)id)->op_sv)) {
+    if (ckWARN(WARN_MISC) &&
+        imop && (imop != arg) && /* no warning on use 5.0; or explicit () */
+        SvPOK(packsv = ((SVOP*)id)->op_sv))
+    {
         /* BEGIN will free the ops, so we need to make a copy */
         packlen = SvCUR(packsv);
         packname = savepvn(SvPVX(packsv), packlen);