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
authorYves Orton <demerphq@gmail.com>
Tue, 13 Feb 2018 23:29:26 +0000 (10:29 +1100)
committerKarl Williamson <khw@cpan.org>
Tue, 17 Apr 2018 02:50:02 +0000 (20:50 -0600)
commit3ed3004ae659b0360a49bd586680461ab3b6a6b7
treec2f35ca1477c2fc2b732954629779c2e7e7e2536
parent9ad8cac45829d8cd51c25f8c6abf8c591514d7e8
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.
regexec.c
t/lib/warnings/regexec
t/re/re_tests