X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=daefb1493e1473bbd97572b9a179021db54f9be6;hb=206b12d5641a74e09d210dd4ea3998febd96392f;hp=c542cbf0bd2f717f08ff5fffbcbfe7af756dd946;hpb=a07e034d5b7121cacfc8c4af9b2736c3d2ab2af3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index c542cbf..daefb14 100644 --- 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);