diff options
author | Tony Cook <tony@develop-help.com> | 2022-09-26 15:03:50 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2022-11-02 09:35:07 +1100 |
commit | a1aa0ce969357a471f335bc9f9362f49f178b1fe (patch) | |
tree | a7a5b2e33e8d7480ce3b47a90e0e4548a93f8a6b /perl.c | |
parent | 8720ab89901b4674570b078a259b3749153f0283 (diff) | |
download | perl-a1aa0ce969357a471f335bc9f9362f49f178b1fe.tar.gz |
We freed PL_splitstr in each thread, allocate it in each thread too
I also fixed const correctness for PL_splitstr, it was initialized
to " " which required it to be const, but the value is only looked
at when PL_minus_F is true, so it wasn't necessary.
So initialize it to NULL, and duplicate the value in threads.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -3585,9 +3585,11 @@ Perl_moreswitches(pTHX_ const char *s) PL_minus_a = TRUE; PL_minus_F = TRUE; PL_minus_n = TRUE; - PL_splitstr = ++s; - while (*s && !isSPACE(*s)) ++s; - PL_splitstr = savepvn(PL_splitstr, s - PL_splitstr); + { + const char *start = ++s; + while (*s && !isSPACE(*s)) ++s; + PL_splitstr = savepvn(start, s - start); + } return s; case 'a': PL_minus_a = TRUE; |