diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-08 16:42:31 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-08 16:42:31 +0000 |
commit | 9a8b670905dec428f75660a49918537c7271b6b6 (patch) | |
tree | 8d1a108b83c4f28673e87e85857cc9562b2958c8 /op.c | |
parent | 7d8473223db014c201b17b33ac514b9e89ac7f71 (diff) | |
download | perl-9a8b670905dec428f75660a49918537c7271b6b6.tar.gz |
Correct a long-standing ithreads reference counting anonamly - the
reference count only needs "doubling" when the scalar is pushed onto
PL_regex_padav for the second time.
p4raw-id: //depot/perl@32899
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -624,7 +624,8 @@ clear_pmop: #ifdef USE_ITHREADS if(PL_regex_pad) { /* We could be in destruction */ ReREFCNT_dec(PM_GETRE(cPMOPo)); - av_push((AV*) PL_regex_pad[0],(SV*) PL_regex_pad[(cPMOPo)->op_pmoffset]); + av_push((AV*) PL_regex_pad[0], + (SV*) SvREFCNT_inc_simple_NN(PL_regex_pad[(cPMOPo)->op_pmoffset])); SvREADONLY_off(PL_regex_pad[(cPMOPo)->op_pmoffset]); SvREPADTMP_on(PL_regex_pad[(cPMOPo)->op_pmoffset]); PM_SETRE_OFFSET(cPMOPo, (cPMOPo)->op_pmoffset); @@ -3373,7 +3374,7 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags) sv_setiv(repointer,0); } else { SV * const repointer = newSViv(0); - av_push(PL_regex_padav, SvREFCNT_inc_simple_NN(repointer)); + av_push(PL_regex_padav, repointer); pmop->op_pmoffset = av_len(PL_regex_padav); PL_regex_pad = AvARRAY(PL_regex_padav); } |