diff options
-rw-r--r-- | t/op/sub.t | 12 | ||||
-rw-r--r-- | t/run/fresh_perl.t | 13 |
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 |