summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2022-12-06 16:14:14 +0000
committerYves Orton <demerphq@gmail.com>2023-02-28 20:53:51 +0800
commite9ba788868247fdfb2a2fbf69079290fb5d11962 (patch)
treef460be086ce0ffc0a9660a923a24c034c7eafcc4 /t
parentdc75098eb38395f6cae58f6e36aacc05d6374c73 (diff)
downloadperl-e9ba788868247fdfb2a2fbf69079290fb5d11962.tar.gz
move test out of fresh_perl.t into sub.t
This test looks for a 'Use of freed value in iteration' warning, which will soon disappear when this branch makes the stack reference counted. Make the test more modifiable so that it can be made conditional on build options.
Diffstat (limited to 't')
-rw-r--r--t/op/sub.t12
-rw-r--r--t/run/fresh_perl.t13
2 files changed, 11 insertions, 14 deletions
diff --git a/t/op/sub.t b/t/op/sub.t
index 09f5609b49..b2839c6a40 100644
--- a/t/op/sub.t
+++ b/t/op/sub.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('../lib');
}
-plan(tests => 63);
+plan(tests => 64);
sub empty_sub {}
@@ -433,3 +433,13 @@ fresh_perl_like(
{},
"GH Issue #16944 - Syntax error with sub and shift causes segfault"
);
+
+# Bug 20010515.004 (#6998)
+# freeing array used as args to sub
+
+fresh_perl_like(
+ q{my @h = 1 .. 10; bad(@h); sub bad { undef @h; warn "O\n"; print for @_; warn "K\n";}},
+ qr/Use of freed value in iteration/,
+ {},
+ "#6998 freeing array used as args to sub",
+);
diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t
index df7cebb80c..e317b8a2f6 100644
--- a/t/run/fresh_perl.t
+++ b/t/run/fresh_perl.t
@@ -619,19 +619,6 @@ EXPECT
-w
"x" =~ /(\G?x)?/;
########
-# Bug 20010515.004 (#6998)
-my @h = 1 .. 10;
-bad(@h);
-sub bad {
- undef @h;
- warn "O\n";
- print for @_;
- warn "K\n";
-}
-EXPECT
-O
-Use of freed value in iteration at - line 7.
-########
# Bug 20010506.041 (#6952)
"abcd\x{1234}" =~ /(a)(b[c])(d+)?/i and print "ok\n";
EXPECT