This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix TRIE_READ_CHAR and DECL_TRIE_TYPE to account for non-utf8 target
This is the third commit involved in [perl #132063, and the bottom line
cause of it. The problem is that the code is incorrectly branching to a
portion of the code that expects it is handling UTF-8. And the input
isn't UTF-8. The fix is to handle this case and branch correctly. This
bug requires the following things in order to manifest:
1) the pattern is compiled under /il
2) the pattern does not contain any characters below 256
3) the target string is not UTF-8.
(The committer changed the test to test this issue on EBCDIC, as the
original \xFF is an invariant there that wouldn't exercise the problem.
We want a start byte for a long UTF-8 sequence for a single character.
On the EBCDIC pages we support, \xFE fits that bill.