summaryrefslogtreecommitdiff
path: root/t/op/do.t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-12-17 12:13:09 +0000
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:18:34 +0000
commit75bc488d4e88019e591cb7483510cbd02ac47320 (patch)
treefc6aad4b7475ac855c032df98ad58dfbaa0fcf90 /t/op/do.t
parente02ce34b5a3c7daaf3131c6aea9a98f7dbbba1b5 (diff)
downloadperl-75bc488d4e88019e591cb7483510cbd02ac47320.tar.gz
replace leave_common() with leave_adjust_stacks()
Make the remaining callers of S_leave_common() use leave_adjust_stacks() instead, then delete this static function. This brings the benefits of freeing TEMPS on all scope exists that has already been introduced on sub exits; uses the optimised code for creating mortal copies; and finally unifies all the different 'process return args on scope exit' implementations into single function.
Diffstat (limited to 't/op/do.t')
-rw-r--r--t/op/do.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/op/do.t b/t/op/do.t
index 3cc4eae72b..0bbab5e506 100644
--- a/t/op/do.t
+++ b/t/op/do.t
@@ -293,4 +293,16 @@ SKIP: {
}->(do { 1; delete $foo{bar} });
}
+# A do block should FREETMPS on exit
+# RT #124248
+
+{
+ package p124248;
+ my $d = 0;
+ sub DESTROY { $d++ }
+ sub f { ::is($d, 1, "RT 124248"); }
+ f(do { 1; !!(my $x = bless []); });
+}
+
+
done_testing();