diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-14 03:57:41 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-14 03:57:41 +0000 |
commit | 4af0bda917eceeead6e59e5dc7c6b28fce055a0a (patch) | |
tree | 4a49cb06e7b48d0aecc3272dd720143c91492414 /op.c | |
parent | 5cfc78421f161e223f47fcc0aa3d4d3fa5f3976e (diff) | |
download | perl-4af0bda917eceeead6e59e5dc7c6b28fce055a0a.tar.gz |
(Retracted by #9150.)
p4raw-id: //depot/perl@9145
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -843,6 +843,29 @@ S_op_clear(pTHX_ OP *o) case OP_MATCH: case OP_QR: clear_pmop: + { + HV *pmstash = PmopSTASH(cPMOPo); + if (pmstash) { + PMOP *pmop = HvPMROOT(pmstash); + PMOP *lastpmop = NULL; + while (pmop) { + if (cPMOPo == pmop) { + if (lastpmop) + lastpmop->op_pmnext = pmop->op_pmnext; + else + HvPMROOT(pmstash) = pmop->op_pmnext; + break; + } + lastpmop = pmop; + pmop = pmop->op_pmnext; + } +#ifdef USE_ITHREADS + Safefree(PmopSTASHPV(cPMOPo)); +#else + /* NOTE: PMOP.op_pmstash is not refcounted */ +#endif + } + } cPMOPo->op_pmreplroot = Nullop; ReREFCNT_dec(cPMOPo->op_pmregexp); cPMOPo->op_pmregexp = (REGEXP*)NULL; @@ -2935,6 +2958,7 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags) if (type != OP_TRANS && PL_curstash) { pmop->op_pmnext = HvPMROOT(PL_curstash); HvPMROOT(PL_curstash) = pmop; + PmopSTASH_set(pmop,PL_curstash); } return (OP*)pmop; |