Yes. I used a static checker developed at MIT called STACK that looks for 
unstable code due to undefined behavior. 

http://css.csail.mit.edu/stack/

Compilers pay close attention to the C standard, and are free to optimize out 
certain logical operations, where possible, in the case of undefined behavior. 
STACK attempts to find these places. In the context of this patch, the null 
pointer check !p with an earlier dereference is dead assuming no null pointer 
dereference. Since these boolean pointers are dereferenced at the beginning of 
the function, STACK picked up the non-NULL checks as unstable code that could 
be optimized out by the compiler.


On Dec 6, 2013, at 5:42 AM, Philip Martin <philip.mar...@wandisco.com> wrote:

> Eric Lubin <e...@lubin.us> writes:
> 
>> [[[
>> * subversion/libsvn_subr/io.c
>>  (contents_three_identical_p): Fixed incorrect pointer check against NULL, 
>> when the purpose was actually to check the value stored at that pointer for 
>> true or false
>> ]]]
> 
> Committed, thanks!  I guess you found these via a compiler warning or
> some static checking tool?
> 
> -- 
> Philip Martin | Subversion Committer
> WANdisco // *Non-Stop Data*

Reply via email to