diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-01 03:00:38 +0200 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-09-01 03:00:38 +0200 |
commit | 10cea94582148cd5bcccfa2723247332e1743303 (patch) | |
tree | 56cfc7866bbabe854d914f7d9b8bd980d976124a /t/io/open.t | |
parent | 6999193ba9069e620831bed0f85efa43ff6e283a (diff) | |
download | perl-10cea94582148cd5bcccfa2723247332e1743303.tar.gz |
[perl #77492] open $fh, ">", \*glob causes SEGV
PerlIO_layer_from_ref must not treat a real glob as a scalar. This
function was not updated when SVt_PVGV was moved before SVt_PVLV.
Diffstat (limited to 't/io/open.t')
-rw-r--r-- | t/io/open.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/io/open.t b/t/io/open.t index 443aab33b6..01bfaca73f 100644 --- a/t/io/open.t +++ b/t/io/open.t @@ -10,7 +10,7 @@ $| = 1; use warnings; use Config; -plan tests => 109; +plan tests => 110; my $Perl = which_perl(); @@ -324,3 +324,16 @@ like($@, qr/Modification of a read-only value attempted/, "readonly fh"); ok( open(my $f, '-|', $p), 'open -| magic'); } + +# [perl #77492] Crash when stringifying a glob, a reference to which has +# been opened and written to. +fresh_perl_is( + ' + open my $fh, ">", \*STDOUT; + print $fh "hello"; + "".*STDOUT; + print "ok"; + unlink \*STDOUT; + ', + 'ok', { stderr => 1 }, + '[perl #77492]: open $fh, ">", \*glob causes SEGV'); |