This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
weak references aren't UVs, do don't show this in the dump flags.
[perl5.git] / dump.c
diff --git a/dump.c b/dump.c
index bfa6727..e047d34 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -406,7 +406,7 @@ sequence(pTHX_ register const OP *o)
 {
     dVAR;
     SV      *op;
-    char    *key;
+    const char *key;
     STRLEN   len;
     const OP *oldop = 0;
     OP      *l;
@@ -415,13 +415,13 @@ sequence(pTHX_ register const OP *o)
        return;
 
     op = newSVuv(PTR2UV(o));
-    key = SvPV(op, len);
+    key = SvPV_const(op, len);
     if (hv_exists(Sequence, key, len))
        return;
 
     for (; o; o = o->op_next) {
        op = newSVuv(PTR2UV(o));
-       key = SvPV(op, len);
+       key = SvPV_const(op, len);
        if (hv_exists(Sequence, key, len))
            break;
 
@@ -501,11 +501,11 @@ sequence_num(pTHX_ const OP *o)
     dVAR;
     SV     *op,
           **seq;
-    char   *key;
+    const char *key;
     STRLEN  len;
     if (!o) return 0;
     op = newSVuv(PTR2UV(o));
-    key = SvPV(op, len);
+    key = SvPV_const(op, len);
     seq = hv_fetch(Sequence, key, len, 0);
     return seq ? SvUV(*seq): 0;
 }
@@ -970,6 +970,7 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
            else if (v == &PL_vtbl_amagicelem) s = "amagicelem";
            else if (v == &PL_vtbl_backref)    s = "backref";
            else if (v == &PL_vtbl_utf8)       s = "utf8";
+            else if (v == &PL_vtbl_arylen_p)   s = "arylen_p";
            if (s)
                Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = &PL_vtbl_%s\n", s);
            else
@@ -1189,7 +1190,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        /* FALL THROUGH */
     default:
        if (SvEVALED(sv))       sv_catpv(d, "EVALED,");
-       if (SvIsUV(sv))         sv_catpv(d, "IsUV,");
+       if (SvIsUV(sv) && !(flags & SVf_ROK))   sv_catpv(d, "IsUV,");
        break;
     case SVt_PVBM:
        if (SvTAIL(sv))         sv_catpv(d, "TAIL,");
@@ -1451,7 +1452,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
                U32 hash = HeHASH(he);
 
                keysv = hv_iterkeysv(he);
-               keypv = SvPV(keysv, len);
+               keypv = SvPV_const(keysv, len);
                elt = hv_iterval(hv, he);
                Perl_dump_indent(aTHX_ level+1, file, "Elt %s ", pv_display(d, keypv, len, 0, pvlim));
                if (SvUTF8(keysv))
@@ -1466,7 +1467,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        break;
     case SVt_PVCV:
        if (SvPOK(sv))
-           Perl_dump_indent(aTHX_ level, file, "  PROTOTYPE = \"%s\"\n", SvPV_nolen(sv));
+           Perl_dump_indent(aTHX_ level, file, "  PROTOTYPE = \"%s\"\n", SvPV_nolen_const(sv));
        /* FALL THROUGH */
     case SVt_PVFM:
        do_hv_dump(level, file, "  COMP_STASH", CvSTASH(sv));
@@ -1619,7 +1620,7 @@ Perl_debop(pTHX_ const OP *o)
        if (cGVOPo_gv) {
            SV *sv = NEWSV(0,0);
            gv_fullname3(sv, cGVOPo_gv, Nullch);
-           PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen(sv));
+           PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
            SvREFCNT_dec(sv);
        }
        else
@@ -1639,7 +1640,7 @@ Perl_debop(pTHX_ const OP *o)
         } else
             sv = Nullsv;
         if (sv)
-           PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen(sv));
+           PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
         else
            PerlIO_printf(Perl_debug_log, "[%"UVuf"]", (UV)o->op_targ);
        }