diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-18 13:34:44 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-18 13:34:44 -0800 |
commit | b73e53856fd974960547b6620ff23e22cf981f7b (patch) | |
tree | 6642beb5bba45fb5f4cea6861773dee8fd109f69 /t | |
parent | 5dd80d85de04555d63d02b50785d3c62029a9375 (diff) | |
download | perl-b73e53856fd974960547b6620ff23e22cf981f7b.tar.gz |
Stop readline(*$glob_copy) from clearing PL_last_in_gv
This is related to commit 8dc99089, which fixed a similar bug in tell.
In readline(*$glob_copy), the * makes a mortal copy of $glob_copy,
turning off its fake flag. readline sets PL_last_in_gv to its argu-
ment, but it gets freed at the end of the statement and PL_last_in_gv
gets cleared.
Diffstat (limited to 't')
-rw-r--r-- | t/op/readline.t | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/t/op/readline.t b/t/op/readline.t index fa0c4f7e4b..944cd7ab46 100644 --- a/t/op/readline.t +++ b/t/op/readline.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 29; +plan tests => 30; # [perl #19566]: sv_gets writes directly to its argument via # TARG. Test that we respect SvREADONLY. @@ -266,6 +266,8 @@ $f{g} = 3; # PL_last_in_gv should be cleared now is tell, -1, 'tell returns -1 after last gv is unglobbed'; $f{g} = *foom; # since PL_last_in_gv is null, this should have no effect is tell, -1, 'unglobbery of last gv nullifies PL_last_in_gv'; +readline *{$f{g}}; +is tell, tell *foom, 'readline *$glob_copy sets PL_last_in_gv'; __DATA__ moo |