X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=5325a5abac03e1976cdd7022e31868815969db1d;hb=52c93dd194e572ccf0cd84fbd063340b76d1a6ba;hp=3dad4882be37ee585c5526e99451d07a429c7750;hpb=cb40c25d04faeb4e704ac10e016eece055ac741f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index 3dad488..5325a5a 100644 --- a/op.c +++ b/op.c @@ -2118,8 +2118,8 @@ Perl_fold_constants(pTHX_ register OP *o) dVAR; register OP *curop; OP *newop; - volatile I32 type = o->op_type; - volatile SV *sv = NULL; + VOL I32 type = o->op_type; + SV * VOL sv = NULL; int ret = 0; I32 oldscope; OP *old_next; @@ -5342,7 +5342,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) else s = tname; - if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I') + if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I' && *s != 'U') goto done; if (strEQ(s, "BEGIN") && !PL_error_count) { @@ -5370,6 +5370,15 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) av_store(PL_endav, 0, (SV*)cv); GvCV(gv) = 0; /* cv has been hijacked */ } + else if (strEQ(s, "UNITCHECK") && !PL_error_count) { + /* It's never too late to run a unitcheck block */ + if (!PL_unitcheckav) + PL_unitcheckav = newAV(); + DEBUG_x( dump_sub(gv) ); + av_unshift(PL_unitcheckav, 1); + av_store(PL_unitcheckav, 0, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ + } else if (strEQ(s, "CHECK") && !PL_error_count) { if (!PL_checkav) PL_checkav = newAV(); @@ -5444,6 +5453,7 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv) cv = newXS_flags(name, const_sv_xsub, file, "", XS_DYNAMIC_FILENAME); CvXSUBANY(cv).any_ptr = sv; CvCONST_on(cv); + Safefree(file); #ifdef USE_ITHREADS if (stash) @@ -6744,16 +6754,6 @@ Perl_ck_listiob(pTHX_ OP *o) } OP * -Perl_ck_say(pTHX_ OP *o) -{ - o = ck_listiob(o); - o->op_type = OP_PRINT; - cLISTOPo->op_last = cLISTOPo->op_last->op_sibling - = newSVOP(OP_CONST, 0, newSVpvs("\n")); - return o; -} - -OP * Perl_ck_smartmatch(pTHX_ OP *o) { dVAR;