This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B::perlstring - add support for \e (Fix #17526)
authorYves Orton <demerphq@gmail.com>
Tue, 4 Feb 2020 08:02:47 +0000 (09:02 +0100)
committerYves Orton <demerphq@gmail.com>
Tue, 4 Feb 2020 08:09:24 +0000 (09:09 +0100)
commit948c73696c11c6875d4a734a634cdcac79331d4c
tree49fe2272432711a04454873a80a73c4768443b97
parentf9c633636bbfa6e7a869340ac7e4ed3244172e5d
B::perlstring - add support for \e (Fix #17526)

In daf6caf1ef25ff48f871fa1e53adcefc11bf1d08 karl made pv_uni_display()
use the available mnemonic escapes instead of using \x{} style escapes.

This broke B::perlstring() which has an exclusion list of such escapes
to passthrough, and it did not know about \e, so it produced "\\e"
instead of "\e", which of course does not round trip.

This in turn broke Sub::Quote, which in turn breaks Moo, which breaks
a lot of stuff. :-)

Unfortunately B::perlstring() had no tests to detect this, so we only
found out when we got a BBC report that happened to also ticklet this
bug.

This patch adds 'e' to the exclusion list, and also adds tests to see
that the the first 1024 unicode codepoints and all 255 non-unicode
codepoints can round trip through B::perlstring().

This should resolve #17526 and indirectly help us close #17245.

With this patch we bump B.pm to v1.80
MANIFEST
ext/B/B.pm
ext/B/B.xs
ext/B/t/perlstring.t [new file with mode: 0644]