Todo updates.
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 3e0d685..677fe7a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -115,7 +115,7 @@ Perl_pad_allocmy(pTHX_ char *name)
 
     if (!(PL_in_my == KEY_our ||
          isALPHA(name[1]) ||
-         (PL_hints & HINT_UTF8 && UTF8_IS_START(name[1])) ||
+         (USE_UTF8_IN_NAMES && UTF8_IS_START(name[1])) ||
          (name[1] == '_' && (int)strlen(name) > 2)))
     {
        if (!isPRINT(name[1]) || strchr("\t\n\r\f", name[1])) {
@@ -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",
@@ -2950,14 +2961,14 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags)
        pmop->op_pmpermflags |= PMf_LOCALE;
     pmop->op_pmflags = pmop->op_pmpermflags;
 
- #ifdef USE_ITHREADS
+#ifdef USE_ITHREADS
         {
                 SV* repointer = newSViv(0);
                 av_push(PL_regex_padav,SvREFCNT_inc(repointer));
                 pmop->op_pmoffset = av_len(PL_regex_padav);
                 PL_regex_pad = AvARRAY(PL_regex_padav);
         }
- #endif
+#endif
         
         /* link into pm list */
     if (type != OP_TRANS && PL_curstash) {
@@ -2991,16 +3002,12 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl)
            p = SvPV(pat, plen);
            pm->op_pmflags |= PMf_SKIPWHITE;
        }
-       if ((PL_hints & HINT_UTF8) || DO_UTF8(pat))
-           pm->op_pmdynflags |= PMdf_UTF8;
        PM_SETRE(pm, CALLREGCOMP(aTHX_ p, p + plen, pm));
        if (strEQ("\\s+", PM_GETRE(pm)->precomp))
            pm->op_pmflags |= PMf_WHITE;
        op_free(expr);
     }
     else {
-       if (PL_hints & HINT_UTF8)
-           pm->op_pmdynflags |= PMdf_UTF8;
        if (pm->op_pmflags & PMf_KEEP || !(PL_hints & HINT_RE_EVAL))
            expr = newUNOP((!(PL_hints & HINT_RE_EVAL)
                            ? OP_REGCRESET
@@ -6871,6 +6878,15 @@ Perl_peep(pTHX_ register OP *o)
                                SvPV_nolen(sv));
                }
            }
+           else if (o->op_next->op_type == OP_READLINE
+                   && o->op_next->op_next->op_type == OP_CONCAT
+                   && (o->op_next->op_next->op_flags & OPf_STACKED))
+           {
+               /* Turn "$a .= <FH>" into an OP_RCATLINE. AMS 20010811 */
+               o->op_next->op_type   = OP_RCATLINE;
+               o->op_next->op_flags |= OPf_STACKED;
+               op_null(o->op_next->op_next);
+           }
 
            o->op_seq = PL_op_seqmax++;
            break;