Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 828ea27ca4b165513ebebcbc39cb0f1ac3d04f17 https://github.com/Perl/perl5/commit/828ea27ca4b165513ebebcbc39cb0f1ac3d04f17 Author: Tony Cook <t...@develop-help.com> Date: 2023-10-05 (Thu, 05 Oct 2023)
Changed paths: M t/op/join.t Log Message: ----------- join: tests from GH #21458 Commit: 6a3cf232a6a4289fcf99cf8bbd3af5e3945913e0 https://github.com/Perl/perl5/commit/6a3cf232a6a4289fcf99cf8bbd3af5e3945913e0 Author: Tony Cook <t...@develop-help.com> Date: 2023-10-05 (Thu, 05 Oct 2023) Changed paths: M t/op/join.t Log Message: ----------- join: add tests from my comments on #21484 Commit: e4be96923581d9d10b5d3dd155992ed3706234cc https://github.com/Perl/perl5/commit/e4be96923581d9d10b5d3dd155992ed3706234cc Author: Tony Cook <t...@develop-help.com> Date: 2023-10-05 (Thu, 05 Oct 2023) Changed paths: M doop.c M t/op/join.t Log Message: ----------- join: save the delimiter string before anything magical happens to it This code had a few problems: - changes to the content of delim from set or overload magic could result in the separator between elements changing during the process of the join. - changes to the content of delim which allocated a new PVX resulted in access to freed memory - changes to the flags of delim, the UTF-8 flag in particular, could result in an invalid joined string, either mojibake or an invalidly encoded upgraded string To avoid that, we copy the separator, either into a local buffer if it's large enough, or an allocated buffer, and save the flag we use, to prevent changes to the delim SV from changing or invalidating the delimpv value. Fixes #21458 and some similar problems. Commit: b209e1e49ee93fd18f111420372a125da94356a3 https://github.com/Perl/perl5/commit/b209e1e49ee93fd18f111420372a125da94356a3 Author: Tony Cook <t...@develop-help.com> Date: 2023-10-05 (Thu, 05 Oct 2023) Changed paths: M doop.c Log Message: ----------- do_join: validate arguments before we start using them Commit: 644bc0a68a0995acf6d0cd939115ce2d8080868e https://github.com/Perl/perl5/commit/644bc0a68a0995acf6d0cd939115ce2d8080868e Author: Tony Cook <t...@develop-help.com> Date: 2023-10-05 (Thu, 05 Oct 2023) Changed paths: M t/op/join.t Log Message: ----------- join tests: comments clarifying why we don't do simple assignment I changed $n to 2 in each case as a defence against a reasonable possible optimisation of $x x 1 sharing the PV with $x. Compare: https://github.com/Perl/perl5/compare/922e8c46512e...644bc0a68a09