mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl 0.8.9 released
@ 2012-04-20  2:06 Rich Felker
  2012-04-22 12:19 ` Pascal Cuoq
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2012-04-20  2:06 UTC (permalink / raw)
  To: musl

Hi again,

Due to the strtol issue that slipped into 0.8.8, I've made another
release. This way there's an official release with the critical
security fix that also actually works.

    Bug-fix release for a serious breakage in strtol and related
    functions that made it into the previous release and prevents them
    from handling numbers with initial spaces. A couple other small
    issues have been fixed too.

    http://www.etalabs.net/musl/releases/musl-0.8.9.tar.gz

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: musl 0.8.9 released
  2012-04-20  2:06 musl 0.8.9 released Rich Felker
@ 2012-04-22 12:19 ` Pascal Cuoq
  2012-04-22 18:05   ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal Cuoq @ 2012-04-22 12:19 UTC (permalink / raw)
  To: musl

On Fri, Apr 20, 2012 at 4:06 AM, Rich Felker <dalias@aerifal.cx> wrote:
>    Bug-fix release for a serious breakage in strtol and related
>    functions that made it into the previous release and prevents them
>    from handling numbers with initial spaces.

Sorry for arriving after the battle, and it is nowhere near as serious, but:

src/internal/floatscan.c, line 136:

	/* Align incomplete final B1B digit */
	if (k<KMAX && j) {

The condition k<KMAX always holds. The earlier for-loop can be exited
with at most k == KMAX-2.
You probably meant:

   if (k < KMAX-2 && j).

If you took a bit of safety margin in your choice of KMAX limits, it
seems to me that it may never matter. But if this is the case, why
bother testing k at all?

Pascal


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: musl 0.8.9 released
  2012-04-22 12:19 ` Pascal Cuoq
@ 2012-04-22 18:05   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2012-04-22 18:05 UTC (permalink / raw)
  To: musl

On Sun, Apr 22, 2012 at 02:19:53PM +0200, Pascal Cuoq wrote:
> On Fri, Apr 20, 2012 at 4:06 AM, Rich Felker <dalias@aerifal.cx> wrote:
> >    Bug-fix release for a serious breakage in strtol and related
> >    functions that made it into the previous release and prevents them
> >    from handling numbers with initial spaces.
> 
> Sorry for arriving after the battle, and it is nowhere near as serious, but:
> 
> src/internal/floatscan.c, line 136:
> 
> 	/* Align incomplete final B1B digit */
> 	if (k<KMAX && j) {
> 
> The condition k<KMAX always holds. The earlier for-loop can be exited
> with at most k == KMAX-2.
> You probably meant:
> 
>    if (k < KMAX-2 && j).
> 
> If you took a bit of safety margin in your choice of KMAX limits, it
> seems to me that it may never matter. But if this is the case, why
> bother testing k at all?

Indeed. There's plenty of extra space in the array because it has to
be rounded up to power-of-two size to avoid expensive mod operations.
Actually, since we only ever inc/dec, I wonder if I should just
replace the masking with a conditional add/sub of KMAX after the
inc/dec; then I could eliminate all the wasted stack space by using a
much smaller value (roughly LDBL_EXP_MAX/12).

In any case, the code does need to ensure that incrementing z does not
overflow in the decimal-point-alignment code that follows, so for now
I'll just make some changes that remove the redundant check and ensure
(perhaps overly careful) that we don't wrap..

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-22 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20  2:06 musl 0.8.9 released Rich Felker
2012-04-22 12:19 ` Pascal Cuoq
2012-04-22 18:05   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).