diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 02:09:25 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-04 02:09:25 +0000 |
commit | cea89e206a8a50eb6e9ed587814e76e98eb0297e (patch) | |
tree | 97846d38c17d48f9a8e54ba7ecbf098c72de4831 /dump.c | |
parent | 157fa42209c56562ffdf582cc345864d8a1744c4 (diff) | |
download | perl-cea89e206a8a50eb6e9ed587814e76e98eb0297e.tar.gz |
This is 6512. Really.
p4raw-id: //depot/perl@6516
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |