summaryrefslogtreecommitdiff
path: root/t/io
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-06 22:17:04 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-06 22:17:04 +0000
commit9cfa90c07dda2bbf7df20096eab1b9057035d586 (patch)
treeba81ae3962d4ec6640cea3d94d57d65b9ee3691f /t/io
parentc3929b7290197fd6055681e2dabb11ad55efccae (diff)
downloadperl-9cfa90c07dda2bbf7df20096eab1b9057035d586.tar.gz
Get the correct refcount on the temporary assignment to PL_sigwarn so
that other code assigning to $SIG{__WARN__} doesn't cause a premature free. p4raw-id: //depot/perl@24410
Diffstat (limited to 't/io')
-rw-r--r--t/io/layers.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/io/layers.t b/t/io/layers.t
index 79800dc068..41c44c478a 100644
--- a/t/io/layers.t
+++ b/t/io/layers.t
@@ -41,7 +41,7 @@ if (${^UNICODE} & 1) {
$UNICODE_STDIN = 1;
}
}
-my $NTEST = 43 - (($DOSISH || !$FASTSTDIO) ? 7 : 0) - ($DOSISH ? 5 : 0)
+my $NTEST = 44 - (($DOSISH || !$FASTSTDIO) ? 7 : 0) - ($DOSISH ? 5 : 0)
+ $UNICODE_STDIN;
sub PerlIO::F_UTF8 () { 0x00008000 } # from perliol.h
@@ -212,5 +212,12 @@ SKIP: {
close G;
}
+ # Check that PL_sigwarn's reference count is correct, and that
+ # &PerlIO::Layer::NoWarnings isn't prematurely freed.
+ fresh_perl_like (<<'EOT', qr/^CODE/);
+open(UTF, "<:raw:encoding(utf8)", $^X) or die $!;
+print ref *PerlIO::Layer::NoWarnings{CODE};
+EOT
+
1 while unlink "afile";
}