diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-27 16:02:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-27 16:02:10 +0000 |
commit | 4155f99a780753efcc886f7e2d4d526b4554b41b (patch) | |
tree | f1528fe6dc645354f515e3229dd5362636e89383 /t | |
parent | b09fc1d8b195e9e9d662d4a40db159f458ff13bd (diff) | |
parent | 6751fbc4613da48d58726f127239e6f792ac8c57 (diff) | |
download | perl-4155f99a780753efcc886f7e2d4d526b4554b41b.tar.gz |
Integrate perlio:
[ 16809]
Add IO::Scalar fail case to the tests.
[ 16808]
Fix for the IO::Scalar bug (I think).
At tie time break the loop but in a different place:
A. Increment REFCNT of the RV involved in the self-tie
B. Decrement REFCNT of the thing RV points to (e.g. the GV)
At mg_free time
Break the connection between the RV and its referent
so that we do not try and free it (again).
[ 16805]
**** UNSAFE **** partial fix for IO::Scalar and local ties.
Only op/local.t fails but it is nasty... try valgrind on other machine.
p4raw-link: @16809 on //depot/perlio: 6751fbc4613da48d58726f127239e6f792ac8c57
p4raw-link: @16808 on //depot/perlio: 3977871ddaef13bab4556a4c080d3871df7b231f
p4raw-link: @16805 on //depot/perlio: 2628be26342842a5f886163d0568170afde998a0
p4raw-id: //depot/perl@16810
Diffstat (limited to 't')
-rwxr-xr-x | t/op/tie.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/tie.t b/t/op/tie.t index 309656da86..d147f6b117 100755 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -135,7 +135,7 @@ untie %h; EXPECT ######## -# strict error behaviour, with 2 extra references +# strict error behaviour, with 2 extra references use warnings 'untie'; use Tie::Hash ; $a = tie %h, Tie::StdHash; @@ -184,13 +184,17 @@ EXPECT # Allowed glob self-ties my $destroyed = 0; +my $printed = 0; sub Self2::TIEHANDLE { bless $_[1], $_[0] } sub Self2::DESTROY { $destroyed = 1; } +sub Self2::PRINT { $printed = 1; } { use Symbol; my $c = gensym; tie *$c, 'Self2', $c; + print $c 'Hello'; } +die "self-tied glob not PRINTed" unless $printed == 1; die "self-tied glob not DESTROYd" unless $destroyed == 1; EXPECT ######## |