Re: [PATCH] fix for programmer error in file equality check due to pointer logic
From: Eric Lubin <eric_at_lubin.us>
Date: Fri, 6 Dec 2013 05:47:41 -0500
Yes. I used a static checker developed at MIT called STACK that looks for unstable code due to undefined behavior.
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.martin_at_wandisco.com> wrote:
> Eric Lubin <eric_at_lubin.us> writes:
This is an archived mail posted to the Subversion Dev mailing list.