Re: [RFC] mb_str_split

From: Date: Sun, 13 Jan 2019 20:21:32 +0000
Subject: Re: [RFC] mb_str_split
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-103722@lists.php.net to get a copy of this message
Help me to find memory leak. Travis CI says: 010+ [Sun Jan 13 18:49:49 2019] Script: '/home/travis/build/php/php-src/ext/mbstring/tests/mb_str_split_jp.php' 011+ /home/travis/build/php/php-src/ext/mbstring/mbstring.c(646) : Freeing 0x00007f59d2c02540 (66 bytes), https://travis-ci.org/php/php-src/jobs/479101356 What to do next? On Sun, 13 Jan 2019 at 16:29, Legale Legage <legale.legale@gmail.com> wrote: > Hello, internals! > NikiC wrote very detailed review about my mb_str_split. So i rewrote the > function completely. While i was working on new implementation i've noticed > something in the mbfl library functions: mbfl_substr and mbfl_strlen. > > > if (encoding->flag & MBFL_ENCTYPE_SBCS) { > len = string->len; > } else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) { > len = string->len/2; > } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) { > len = string->len/4; > } > > There is 2 more 2-bytes width encodings: MBFL_ENCTYPE_MWC2BE (UTF16-BE), > MBFL_ENCTYPE_MWC2LE (UTF16-LE). > > Is this a mistake or not? > > Please check: > > https://github.com/php/php-src/blob/30668755b64aa732246d952451f89d1fcfe581f0/ext/mbstring/libmbfl/mbfl/mbfilter.c#L659Swî‹Ep• > ‚Œ-½ÈB >

« previous php.internals (#103722) next »