diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-02-26 09:18:44 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-05-24 15:50:57 +0100 |
commit | adf8f095c5881bcedf07b8e41072f8125e00b5a6 (patch) | |
tree | 60fefd15aa87c06d10518762c8a403c21c964155 /t/op | |
parent | 05d04d9c74ee968bace5e063c9ded74f94b3df24 (diff) | |
download | perl-adf8f095c5881bcedf07b8e41072f8125e00b5a6.tar.gz |
Set PADSTALE on all lexicals at the end of sub creation.
The PADSTALEness of lexicals between the 0th and 1st call to a subroutine is now
consistent with the state between the nth and (n + 1)th call.
This permits a work around in Perl_padlist_dup() to avoid leaking active pad
data into a new thread, whilst still correctly bodging the external references
needed by the current ?{} implementation. Fix that, and this can be removed.
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/threads.t | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/threads.t b/t/op/threads.t index 8fa602528b..d8bab5b475 100644 --- a/t/op/threads.t +++ b/t/op/threads.t @@ -16,7 +16,7 @@ BEGIN { exit 0; } - plan(21); + plan(22); } use strict; @@ -274,4 +274,22 @@ EOI curr_test(curr_test() + 1); } +{ + my $got; + sub more_stuff { + my $a; + $::b = \$a; + if (@_) { + $a = "More leakage"; + threads->create(\&more_stuff)->join(); + } else { + is ($a, undef, 'Just special casing lexicals in ?{ ... }'); + } + } + + more_stuff(1); + + curr_test(curr_test() + 1); +} + # EOF |