with the -R debugging flag, SVs are displayed with a reference count
(if > 1), and with a T if the SV is referenced from the temps stack.
E.g.
$ perl -DstR -e'@a = map $_,"a", "b"'
...
* <T>PV("a"\0) <T>PV("b"\0)
This commit enhances this to use both "t" and "T":
t: SV is referenced from PL_tmps_stack, but SvTEMP() not set
T: SV is referenced from PL_tmps_stack, and in addition, SvTEMP() is set
(The other permutation, SvTEMP() set but not in PL_tmps_stack, is
illegal).
This commit changes
break;
}
}
- if (SvREFCNT(sv) > 1)
- Perl_sv_catpvf(aTHX_ t, "<%"UVuf"%s>", (UV)SvREFCNT(sv),
- is_tmp ? "T" : "");
- else if (is_tmp)
- sv_catpv(t, "<T>");
+ if (is_tmp || SvREFCNT(sv) > 1) {
+ Perl_sv_catpvf(aTHX_ t, "<");
+ if (SvREFCNT(sv) > 1)
+ Perl_sv_catpvf(aTHX_ t, "%"UVuf, (UV)SvREFCNT(sv));
+ if (is_tmp)
+ Perl_sv_catpvf(aTHX_ t, "%s", SvTEMP(t) ? "T" : "t");
+ Perl_sv_catpvf(aTHX_ t, ">");
+ }
}
if (SvROK(sv)) {