[PATCH] Check for null pointers in ubsan

Nuno Lopes nunoplopes at sapo.pt
Mon May 11 14:40:39 PDT 2015


> On Mon, May 11, 2015 at 07:00:53PM +0000, Nuno Lopes wrote:
>> gcc 4.9 just got more aggressive and is now exploiting the fact that
>> input pointers to memcpy/memmove cannot be null (even if the size is 0).
>
> Are you sure that this is GCC and not glibc? Can someone *please* raise
> a defect report against the C standard? This is ridiculous...

I had to debug a big project over this weekend because it was being 
miscompiled with gcc 4.9.
Apparently the porting guide (https://gcc.gnu.org/gcc-4.9/porting_to.html) 
states that gcc is now more aggressive in optimizing away null pointer 
checks.

Nuno 




More information about the cfe-commits mailing list