This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change 33069 missed updating dump.c to dump PVIOs correctly.
authorNicholas Clark <nick@ccl4.org>
Sat, 26 Jan 2008 10:24:40 +0000 (10:24 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 26 Jan 2008 10:24:40 +0000 (10:24 +0000)
p4raw-id: //depot/perl@33071

dump.c
ext/Devel/Peek/t/Peek.t

diff --git a/dump.c b/dump.c
index 3e4db86..3147286 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1554,7 +1554,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
                         (UV) COP_SEQ_RANGE_HIGH(sv));
     } else if ((type >= SVt_PVNV && type != SVt_PVAV && type != SVt_PVHV
                && type != SVt_PVCV && type != SVt_PVFM  && type != SVt_REGEXP
-               && !isGV_with_GP(sv) && !SvVALID(sv))
+               && type != SVt_PVIO && !isGV_with_GP(sv) && !SvVALID(sv))
               || type == SVt_NV) {
        STORE_NUMERIC_LOCAL_SET_STANDARD();
        /* %Vg doesn't work? --jhi */
index 47f8ab2..e62ffdf 100644 (file)
@@ -14,7 +14,7 @@ BEGIN { require "./test.pl"; }
 
 use Devel::Peek;
 
-plan(48);
+plan(50);
 
 our $DEBUG = 0;
 open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
@@ -45,6 +45,9 @@ sub do_test {
                ($] < 5.009) ? "    IV = 0\n    NV = 0\n" : '';
            /mge;
            $pattern =~ s/\$RV/IV/g if $] >= 5.011;
+           $pattern =~ s/^ *\$NV *\n/
+               ($] < 5.011) ? "    NV = 0\n" : '';
+           /mge;
 
            print $pattern, "\n" if $DEBUG;
            my ($dump, $dump2) = split m/\*\*\*\*\*\n/, scalar <IN>;
@@ -541,3 +544,28 @@ do_test(24,
   UV = \d+
   NV = 0
   PV = 0');
+
+do_test(25,
+       *STDOUT{IO},
+'SV = $RV\\($ADDR\\) at $ADDR
+  REFCNT = 1
+  FLAGS = \\(ROK\\)
+  RV = $ADDR
+  SV = PVIO\\($ADDR\\) at $ADDR
+    REFCNT = 3
+    FLAGS = \\(OBJECT\\)
+    IV = 0
+    $NV
+    STASH = $ADDR\s+"IO::Handle"
+    IFP = $ADDR
+    OFP = $ADDR
+    DIRP = 0x0
+    LINES = 0
+    PAGE = 0
+    PAGE_LEN = 60
+    LINES_LEFT = 0
+    TOP_GV = 0x0
+    FMT_GV = 0x0
+    BOTTOM_GV = 0x0
+    TYPE = \'>\'
+    FLAGS = 0x0');