From: Nicholas Clark Date: Mon, 23 May 2005 11:27:16 +0000 (+0000) Subject: PL_regex_padav elements hold either more AVs, or IVs that point to X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a560f29b68cee2c6b71ff8f85b84ebab612b34b0;p=p5sagit%2Fp5-mst-13.2.git PL_regex_padav elements hold either more AVs, or IVs that point to regexps. Don't attempt to look at the IVX if it's not an IV. p4raw-id: //depot/perl@24549 --- diff --git a/perl.c b/perl.c index 4ebcefa..babaaed 100644 --- a/perl.c +++ b/perl.c @@ -539,7 +539,6 @@ perl_destruct(pTHXx) while (i) { SV *resv = ary[--i]; - REGEXP *re = INT2PTR(REGEXP *,SvIVX(resv)); if (SvFLAGS(resv) & SVf_BREAK) { /* this is PL_reg_curpm, already freed @@ -550,7 +549,8 @@ perl_destruct(pTHXx) else if(SvREPADTMP(resv)) { SvREPADTMP_off(resv); } - else { + else if(SvIOKp(resv)) { + REGEXP *re = INT2PTR(REGEXP *,SvIVX(resv)); ReREFCNT_dec(re); } } diff --git a/sv.c b/sv.c index 0a27714..8fe9be0 100644 --- a/sv.c +++ b/sv.c @@ -1872,7 +1872,6 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) AvALLOC(sv) = 0; AvARYLEN(sv)= 0; AvREAL_only(sv); - SvIVX(sv) = 0; } /* to here. */ /* XXX? Only SVt_NULL is ever upgraded to AV or HV? */