Add a test that "eval" does not create additional reference to ouside variables.
[p5sagit/p5-mst-13.2.git] / t / op / threads.t
index 814b595..7985688 100644 (file)
@@ -16,7 +16,7 @@ BEGIN {
        exit 0;
      }
 
-     plan(13);
+     plan(15);
 }
 
 use strict;
@@ -185,5 +185,27 @@ threads->new(\&safe_re)->join();
 # tests in threads don't get counted, so
 curr_test(curr_test() + 1);
 
+# This used to crash in 5.10.0 [perl #64954]
+
+undef *a;
+threads->new(sub {})->join;
+pass("undefing a typeglob doesn't cause a crash during cloning");
+
+
+TODO: {
+    no strict 'vars';   # Accessing $TODO from test.pl
+    local $TODO = 'perl #70748';
+
+# Test we don't get:
+# panic: del_backref during global destruction.
+fresh_perl_is(<<'EOI', 'ok', { }, 'No del_backref panic');
+use threads;
+sub foo { return (sub { }); }
+my $bar = threads->create(\&foo)->join();
+threads->create(sub { })->join();
+print "ok";
+EOI
+
+} # TODO
 
 # EOF