This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_peek(): SvOOK offset is no longer in IVX
authorDavid Mitchell <davem@iabyn.com>
Sun, 16 Aug 2009 15:19:04 +0000 (16:19 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 16 Aug 2009 15:19:04 +0000 (16:19 +0100)
dump.c

diff --git a/dump.c b/dump.c
index af735b5..e7f5a1d 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -505,8 +505,11 @@ Perl_sv_peek(pTHX_ SV *sv)
        else {
            SV * const tmp = newSVpvs("");
            sv_catpv(t, "(");
-           if (SvOOK(sv))
-               Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX_const(sv)-SvIVX(sv), SvIVX(sv), 0, 127));
+           if (SvOOK(sv)) {
+               STRLEN delta;
+               SvOOK_offset(sv, delta);
+               Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX_const(sv)-delta, delta, 0, 127));
+           }
            Perl_sv_catpvf(aTHX_ t, "%s)", pv_display(tmp, SvPVX_const(sv), SvCUR(sv), SvLEN(sv), 127));
            if (SvUTF8(sv))
                Perl_sv_catpvf(aTHX_ t, " [UTF8 \"%s\"]",