From: Gurusamy Sarathy Date: Fri, 3 Apr 1998 07:22:50 +0000 (+0000) Subject: [win32] fixup hv_free_ent() to not fail on null HeVAL() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16bdeea22f8cedc459c05644ea5e42bd8370b42c;p=p5sagit%2Fp5-mst-13.2.git [win32] fixup hv_free_ent() to not fail on null HeVAL() p4raw-id: //depot/win32/perl@866 --- diff --git a/hv.c b/hv.c index e7d2075..f35c180 100644 --- a/hv.c +++ b/hv.c @@ -836,11 +836,14 @@ newHV(void) void hv_free_ent(HV *hv, register HE *entry) { + SV *val; + if (!entry) return; - if (isGV(HeVAL(entry)) && GvCVu(HeVAL(entry)) && HvNAME(hv)) + val = HeVAL(entry); + if (isGV(val) && GvCVu(val) && HvNAME(hv)) sub_generation++; /* may be deletion of method from stash */ - SvREFCNT_dec(HeVAL(entry)); + SvREFCNT_dec(val); if (HeKLEN(entry) == HEf_SVKEY) { SvREFCNT_dec(HeKEY_sv(entry)); Safefree(HeKEY_hek(entry)); diff --git a/perl.c b/perl.c index 6ded533..f84e241 100644 --- a/perl.c +++ b/perl.c @@ -493,7 +493,7 @@ perl_destruct(register PerlInterpreter *sv_interp) if (hent) { warn("Unbalanced string table refcount: (%d) for \"%s\"", HeVAL(hent) - Nullsv, HeKEY(hent)); - HeVAL(hent) = &sv_undef; + HeVAL(hent) = Nullsv; hent = HeNEXT(hent); } if (!hent) {