From: Nicholas Clark Date: Thu, 10 Jan 2008 23:32:27 +0000 (+0000) Subject: Change 32899 missed undoing the reference count increase when the SV X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=110f3028c15a78b9155d8d56077236a8a2a126d0;p=p5sagit%2Fp5-mst-13.2.git Change 32899 missed undoing the reference count increase when the SV is popped off the AV. "There's Something Wrong with our Bloody Leak Checking Today", as Beattie didn't put it. It seems that we really can't check for leaking scalars in perl_destruct, because we do our damndest to free them brute force, rather than by undefining the symbol table and seeing what sticks around. p4raw-id: //depot/perl@32942 --- diff --git a/op.c b/op.c index d838325..34eb2e6 100644 --- a/op.c +++ b/op.c @@ -3368,8 +3368,12 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags) #ifdef USE_ITHREADS if (av_len((AV*) PL_regex_pad[0]) > -1) { SV * const repointer = av_pop((AV*)PL_regex_pad[0]); - pmop->op_pmoffset = SvIV(repointer); + const IV offset = SvIV(repointer); + pmop->op_pmoffset = offset; sv_setiv(repointer,0); + assert(repointer == PL_regex_pad[offset]); + /* One reference remains, in PL_regex_pad[offset] */ + SvREFCNT_dec(repointer); } else { SV * const repointer = newSViv(0); av_push(PL_regex_padav, repointer);