diff options
author | Karl Williamson <khw@cpan.org> | 2017-02-13 12:35:18 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-02-13 21:24:08 -0700 |
commit | efa571ab2dff0efcc97f14f98ed11f9296cd27a7 (patch) | |
tree | 07a927f327e3eca743e6d792b548f1a9c78da827 /parser.h | |
parent | 5d382c252dbb26302398c7fe38021a0f3c06b809 (diff) | |
download | perl-efa571ab2dff0efcc97f14f98ed11f9296cd27a7.tar.gz |
toke.c: Fix bugs where UTF-8 is turned on in mid chunk
Previous commits have tightened up the checking of UTF-8 for
well-formedness in the input program or string eval. This is done in
lex_next_chunk and lex_start. But it doesn't handle the case of
use utf8; foo
because 'foo' is checked while UTF-8 is still off. This solves that
problem by noticing when utf8 is turned on, and then rechecking at the
next opportunity.
See thread beginning at
http://nntp.perl.org/group/perl.perl5.porters/242916
This fixes [perl #130675]. A test will be added in a future commit
This catches some errors earlier than they used to be and aborts. so
some tests in the suite had to be split into multiple parts.
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -115,6 +115,8 @@ typedef struct yy_parser { IV sig_optelems; /* number of optional signature elems seen */ char sig_slurpy; /* the sigil of the slurpy var (or null) */ + bool recheck_utf8_validity; + PERL_BITFIELD16 in_pod:1; /* lexer is within a =pod section */ PERL_BITFIELD16 filtered:1; /* source filters in evalbytes */ PERL_BITFIELD16 saw_infix_sigil:1; /* saw & or * or % operator */ |