diff options
author | Jonathan Stowe <gellyfish@gellyfish.com> | 2002-01-05 12:43:47 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-06 15:33:51 +0000 |
commit | 1f01e11eb53fe625c394d67fb2e0e4612a63b140 (patch) | |
tree | 8801a18a8bfe83b24845375747f2bf8a721fa210 /pp_sys.c | |
parent | 4f25a73b468f124cd24b712b379ac0842e3814ff (diff) | |
download | perl-1f01e11eb53fe625c394d67fb2e0e4612a63b140.tar.gz |
Fix segfault in dbmclose in DESTROY (was Re: [ID 20020104.007] coredump on dbmclose)
Message-ID: <Pine.LNX.4.33.0201051240130.5428-100000@orpheus.gellyfish.com>
p4raw-id: //depot/perl@14106
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -838,24 +838,26 @@ PP(pp_untie) SV *obj = SvRV(mg->mg_obj); GV *gv; CV *cv = NULL; - if ((gv = gv_fetchmethod_autoload(SvSTASH(obj), "UNTIE", FALSE)) && - isGV(gv) && (cv = GvCV(gv))) { - PUSHMARK(SP); - XPUSHs(SvTIED_obj((SV*)gv, mg)); - XPUSHs(sv_2mortal(newSViv(SvREFCNT(obj)-1))); - PUTBACK; - ENTER; - call_sv((SV *)cv, G_VOID); - LEAVE; - SPAGAIN; - } - else if (ckWARN(WARN_UNTIE)) { - if (mg && SvREFCNT(obj) > 1) - Perl_warner(aTHX_ WARN_UNTIE, - "untie attempted while %"UVuf" inner references still exist", - (UV)SvREFCNT(obj) - 1 ) ; + if (obj) { + if ((gv = gv_fetchmethod_autoload(SvSTASH(obj), "UNTIE", FALSE)) && + isGV(gv) && (cv = GvCV(gv))) { + PUSHMARK(SP); + XPUSHs(SvTIED_obj((SV*)gv, mg)); + XPUSHs(sv_2mortal(newSViv(SvREFCNT(obj)-1))); + PUTBACK; + ENTER; + call_sv((SV *)cv, G_VOID); + LEAVE; + SPAGAIN; + } + else if (ckWARN(WARN_UNTIE)) { + if (mg && SvREFCNT(obj) > 1) + Perl_warner(aTHX_ WARN_UNTIE, + "untie attempted while %"UVuf" inner references still exist", + (UV)SvREFCNT(obj) - 1 ) ; + } } - sv_unmagic(sv, how); + sv_unmagic(sv, how) ; } RETPUSHYES; } |