From: Jarkko Hietaniemi Date: Fri, 4 Aug 2000 02:09:25 +0000 (+0000) Subject: This is 6512. Really. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cea89e206a8a50eb6e9ed587814e76e98eb0297e;p=p5sagit%2Fp5-mst-13.2.git This is 6512. Really. p4raw-id: //depot/perl@6516 --- diff --git a/dump.c b/dump.c index 86c56ce..1570a91 100644 --- a/dump.c +++ b/dump.c @@ -769,7 +769,7 @@ void Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim) { dTHR; - SV *d = sv_newmortal(); + SV *d; char *s; U32 flags; U32 type; @@ -783,7 +783,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo flags = SvFLAGS(sv); type = SvTYPE(sv); - Perl_sv_setpvf(aTHX_ d, + d = Perl_newSVpvf(aTHX_ "(0x%"UVxf") at 0x%"UVxf"\n%*s REFCNT = %"IVdf"\n%*s FLAGS = (", PTR2UV(SvANY(sv)), PTR2UV(sv), (int)(PL_dumpindent*level), "", (IV)SvREFCNT(sv), @@ -867,6 +867,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo switch (type) { case SVt_NULL: PerlIO_printf(file, "NULL%s\n", s); + SvREFCNT_dec(d); return; case SVt_IV: PerlIO_printf(file, "IV%s\n", s); @@ -915,6 +916,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo break; default: PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s); + SvREFCNT_dec(d); return; } if (type >= SVt_PVIV || type == SVt_IV) { @@ -940,10 +942,13 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo Perl_dump_indent(aTHX_ level, file, " RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv))); if (nest < maxnest) do_sv_dump(level+1, file, SvRV(sv), nest+1, maxnest, dumpops, pvlim); + SvREFCNT_dec(d); return; } - if (type < SVt_PV) + if (type < SVt_PV) { + SvREFCNT_dec(d); return; + } if (type <= SVt_PVLV) { if (SvPVX(sv)) { Perl_dump_indent(aTHX_ level, file," PV = 0x%"UVxf" ", PTR2UV(SvPVX(sv))); @@ -1178,6 +1183,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv)); break; } + SvREFCNT_dec(d); } void