diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-18 19:06:05 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-18 19:06:05 +0000 |
commit | 209a9bc1bcfe078e350f0f6efa8375fce6dcbb44 (patch) | |
tree | c2a0f03103452f6a54bc214dfe6dc6062a6cec59 /utf8.c | |
parent | a0405c928fce3c813775d09acdf2325ec8e1b2ed (diff) | |
download | perl-209a9bc1bcfe078e350f0f6efa8375fce6dcbb44.tar.gz |
Workaround for the "\x{12345678}" plus s/(.)/$1/g plus ord/length
bug noticed by Robin Houston; basically the code of detecting
value wraparound was acting differently under different compilers
and platforms. The workaround is to remove the overflow check
for now, a real fix would be to do the overflow (portably) right.
p4raw-id: //depot/perl@9740
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -170,8 +170,13 @@ Perl_is_utf8_char(pTHX_ U8 *s) if (!UTF8_IS_CONTINUATION(*s)) return 0; uv = UTF8_ACCUMULATE(uv, *s); - if (uv < ouv) +#if 0 + /* Depending on the compiler the wrap of the value takig pladve + * between 5 and 6 bytes of UTF-8 encoding either works or not. + * See similar spot in utf8_to_uvuni(). --jhi */ + if (uv < ouv) return 0; +#endif ouv = uv; s++; } @@ -342,9 +347,14 @@ Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags) } } else { /* uv < ouv */ +#if 0 + /* Depending on the compiler the wrap of the value takig pladve + * between 5 and 6 bytes of UTF-8 encoding either works or not. + * See similar spot in is_utf8_char(). --jhi */ /* This cannot be allowed. */ warning = UTF8_WARN_OVERFLOW; goto malformed; +#endif } } s++; |