summaryrefslogtreecommitdiff
path: root/t/op/sub.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/sub.t')
-rw-r--r--t/op/sub.t12
1 files changed, 11 insertions, 1 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",
+);