This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Set PADSTALE on all lexicals at the end of sub creation.
[perl5.git] / t / op / threads.t
index 8fa6025..d8bab5b 100644 (file)
@@ -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