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;
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),
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);
break;
default:
PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s);
+ SvREFCNT_dec(d);
return;
}
if (type >= SVt_PVIV || type == SVt_IV) {
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)));
Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv));
break;
}
+ SvREFCNT_dec(d);
}
void