|
Message-Id: <52460a2d.e2a1440a.2f4d.6551@mx.google.com> Date: Fri, 27 Sep 2013 15:43:53 -0700 From: Michael Forney <mforney@...rney.org> To: musl@...ts.openwall.com Subject: Re: [PATCH] mbsrtowcs: Fix bug when wn is a multiple of 4 On Fri, 27 Sep 2013 11:56:18 -0400, Rich Felker <dalias@...ifal.cx> wrote: > > Rather than adding an extra branch here, why not just either change > > the >=4 condition to >=5 or unconditionally continue here? Any > > thoughts on what would be better? > > Forget what I said about just continuing; it would lead to an infinite > loop. I think checking for wn>=5 is probably the best solution to > avoid extra branches in a fairly common code path (ASCII at an aligned > position but not 4 ASCII characters in a row). At some point perhaps > all of this code should be reworked (with proper benchmarking to > measure the effect of changes) but for now we just need a fix. > > Rich Yeah, I didn't make any performance considerations, I just figured this would be the easiest/simplest fix. The solution you've committed is fine. Thanks! -- Michael Forney <mforney@...rney.org>
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.