summaryrefslogtreecommitdiff
path: root/t/op/goto.t
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-10-23 21:50:19 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-10-23 21:50:19 +0000
commitb1464ded1acfef257a05adfafdd413fb0659a7e5 (patch)
tree01d7f3cc46e4b201b8310299bb721bbb4121eb1c /t/op/goto.t
parentf9d05ba35dc7d01260b38a6dc93f199c3b1d2c39 (diff)
downloadperl-b1464ded1acfef257a05adfafdd413fb0659a7e5.tar.gz
[perl #32039] Chained goto &sub drops data too early.
Change 22373 to stop a memory leak in goto &foo intead caused the elements of @_ to be freed too early. This revised fix just transfers the reifiedness of the old @_ to the new @_ p4raw-id: //depot/perl@23418
Diffstat (limited to 't/op/goto.t')
-rwxr-xr-xt/op/goto.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/op/goto.t b/t/op/goto.t
index c0936a7c23..3b921238f2 100755
--- a/t/op/goto.t
+++ b/t/op/goto.t
@@ -7,7 +7,7 @@ BEGIN {
@INC = qw(. ../lib);
}
-print "1..46\n";
+print "1..47\n";
require "test.pl";
@@ -407,4 +407,12 @@ sub recurse2 {
print "not " unless recurse1(500) == 500;
print "ok 46 - recursive goto &foo\n";
+# [perl #32039] Chained goto &sub drops data too early.
+
+sub a32039 { @_=("foo"); goto &b32039; }
+sub b32039 { goto &c32039; }
+sub c32039 { print $_[0] eq 'foo' ? "" : "not ", "ok 47 - chained &goto\n" }
+a32039();
+
+