diff options
author | Karl Williamson <khw@cpan.org> | 2015-11-23 15:00:55 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-11-25 15:48:17 -0700 |
commit | b67fd2c557cdf9bdc899813a5e4f2dee22e4f63e (patch) | |
tree | 055007b23413908232464966d3435a702fb4424a /dist/Test | |
parent | 1d1c12d9a3f5f51cb9639329ae0b854f2dab7b05 (diff) | |
download | perl-b67fd2c557cdf9bdc899813a5e4f2dee22e4f63e.tar.gz |
toke.c: Remove soon-to-be invalid t assumption
The code in toke.c assumes that the UTF8 expansion of the string
"\x{foo}" takes no more bytes than the original input text, which
includes the 4 bytes of overhead "\x{}". Similarly for "\o{}". The
functions that convert to the code point actually now assert for this.
The next commit will make this assumption definitely invalid on EBCDIC
platforms. Remove the assertions, and actually handle the case
properly. The other places that call the conversion functions do not
make this assumption, so there is no harm in removing them from there.
Since we believe that this can't happen except on EBCDIC, we
could #ifdef this code and use just an assert on non-EBCDIC. But it's
easier to maintain if #ifdef's are minimized. Parsing is not a
time-critical operation, like being in an inner loop, and the extra test
gives a branch prediction hint to the compiler.
Diffstat (limited to 'dist/Test')
0 files changed, 0 insertions, 0 deletions