In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/d5a163ad1974ba765cb85fdba390c24817141ec4?hp=be98855787c93fb16a7d4974601d4c8cf91ab8cb>

- Log -----------------------------------------------------------------
commit d5a163ad1974ba765cb85fdba390c24817141ec4
Author: David Mitchell <[email protected]>
Date:   Wed Oct 26 17:48:44 2016 +0100

    -DsR : display unTEMPed temps with "t" not "T"
    
    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
-----------------------------------------------------------------------

Summary of changes:
 dump.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dump.c b/dump.c
index d2d7f67a8c..3e1b011fc4 100644
--- a/dump.c
+++ b/dump.c
@@ -421,11 +421,14 @@ Perl_sv_peek(pTHX_ SV *sv)
                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)) {

--
Perl5 Master Repository

Reply via email to