develooper Front page | perl.perl5.porters | Postings from September 2011

[perl #99542] lex_read_unichar fails to handle 80-FF under "no utf8;"

Thread Previous
From:
Eric Brine
Date:
September 19, 2011 17:25
Subject:
[perl #99542] lex_read_unichar fails to handle 80-FF under "no utf8;"
Message ID:
rt-3.6.HEAD-31297-1316478338-620.99542-75-0@perl.org
# New Ticket Created by  "Eric Brine" 
# Please include the string:  [perl #99542]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=99542 >


This is a bug report for perl from ikegami@adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.14.0.


-----------------------------------------------------------------
[Please describe your issue here]

Under "no utf8;", lex_peek_unichar will correctly return 0xE9
when encountering byte E9. However, when trying to advance the
buffer pointer using lex_read_unichar, it skips forward three
bytes instead of one.

The fix is simple: lex_read_unichar should head the value of
UTF (like lex_peek_unichar does). Patch attached.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.14.0:

Configured by eric at Fri Jun 10 15:56:22 EDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration:

  Platform:
    osname=linux, osvers=2.6.32-5-686, archname=i686-linux-thread-multi
    uname='linux fmdev10 2.6.32-5-686 #1 smp tue mar 8 21:36:00 utc 2011
i686 gnulinux '
    config_args='-de -Dprefix=/home/eric/usr/perlbrew/perls/perl-5.14.0t
-Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.5', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64
/usr/lib64
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'

Locally applied patches:


---
@INC for perl 5.14.0:

/home/eric/usr/perlbrew/perls/perl-5.14.0t/lib/site_perl/5.14.0/i686-linux-thread-multi
    /home/eric/usr/perlbrew/perls/perl-5.14.0t/lib/site_perl/5.14.0

/home/eric/usr/perlbrew/perls/perl-5.14.0t/lib/5.14.0/i686-linux-thread-multi
    /home/eric/usr/perlbrew/perls/perl-5.14.0t/lib/5.14.0
    .

---
Environment for perl 5.14.0:
    HOME=/home/eric
    LANG=en_US.UTF-8
    LANGUAGE=
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=/home/eric/usr/perlbrew/bin:/home/eric/usr/perlbrew/perls/perl-5.14.0t/bin:.:/home/eric/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
    PERLBREW_HOME=/home/eric/.perlbrew

PERLBREW_PATH=/home/eric/usr/perlbrew/bin:/home/eric/usr/perlbrew/perls/perl-5.14.0t/bin
    PERLBREW_PERL=perl-5.14.0t
    PERLBREW_ROOT=/home/eric/usr/perlbrew
    PERLBREW_VERSION=0.25
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About