2009/3/23 Marsh Ray <[email protected]>:
> Sune Rievers wrote:
>>
>> NULL tests on already tested values are removed with this patch, as
>> well as redundant NULL checks. For instance, if a pointer is checked
>> for NULL, and afterwards an error occurs, and execution moves to an
>> error label, there are several cases where the pointer again is
>> checked for NULL, which could never occur in the given code path.
>
> Is that _really_ a problem that needs fixing?
>
> I mean, the if the error case is running so often that it imposes noticeable
> overhead, something else is probably majorly wrong in the application.

Of cause not, it was merely ment as an optimization. I think that
these fixes are proper, because they make functions smaller, and
easier to view and debug.
It's probably only an optimization LOC-wise, I don't think it has much
impact at runtime.

> If the error check is truly trivially redundant, I would expect most
> optimizing compilers to eliminate it anyway.
>
> So as a user of OpenSSL (who was in fact recently bitten by insufficient
> NULL checking in the codebase), it's worth approximately _zero_ new risk  to
> me for this kind of micro-optimizations.

Fair enough, I just thought I would submit my findings, as I like to
keep my own code very tight regarding these things.

-- Sune Rievers
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to