From: Gerard Goossen Date: Tue, 10 Nov 2009 12:37:38 +0000 (+0100) Subject: Test for a bug in sort where the elements are freed in the sort block. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84df657f04b1025e03d7845847755bde20f5a70c;p=p5sagit%2Fp5-mst-13.2.git Test for a bug in sort where the elements are freed in the sort block. --- diff --git a/t/op/sort.t b/t/op/sort.t index 8484827..75b9a17 100644 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -6,7 +6,7 @@ BEGIN { require 'test.pl'; } use warnings; -plan( tests => 146 ); +plan( tests => 147 ); # these shouldn't hang { @@ -768,6 +768,12 @@ cmp_ok($answer,'eq','good','sort subr called from other package'); cmp_ok(substr($@,0,length($fail_msg)),'eq',$fail_msg,'bug 7567'); } +{ + local $TODO = "sort should make sure elements are not freed in the sort block"; + eval { @nomodify_x=(1..8); our @copy = sort { @nomodify_x = (0) } (@nomodify_x, 3); }; + is($@, ""); +} + # Sorting shouldn't increase the refcount of a sub {