summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2022-09-26 15:13:02 +1000
committerTony Cook <tony@develop-help.com>2022-11-02 09:35:07 +1100
commit4f8b3850b207c4a8adaaba6caf82902c90cee8b6 (patch)
tree8443190869f93f73dd52d8a638b22f5fdba5c706 /t
parenta1aa0ce969357a471f335bc9f9362f49f178b1fe (diff)
downloadperl-4f8b3850b207c4a8adaaba6caf82902c90cee8b6.tar.gz
duplicate -F switches would overwrite PL_splitstr without freeing
Of course, it wasn't safe to free it before the previous patch, but it is now.
Diffstat (limited to 't')
-rw-r--r--t/run/switchF2.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/run/switchF2.t b/t/run/switchF2.t
index 507459e3d8..5a434eb782 100644
--- a/t/run/switchF2.t
+++ b/t/run/switchF2.t
@@ -38,4 +38,14 @@ SKIP:
}, "PL_splitstr freed in each thread");
}
+{
+ # old value of PL_splitstr wasn't freed with multiple switches (it wasn't safe to before)
+ # this would only fail under valgrind/LSAN
+ fresh_perl_is('print $F[1]', "b",
+ {
+ switches => [ "-F:", "-F," ],
+ stdin => "a,b,c",
+ }, "PL_splitstr freed on extra -F switch");
+}
+
done_testing();