On Jan 5, 2010, at 1:27 AM, Zhongxing Xu wrote:

I reverted this patch, and fix the analyzer in r92723.

Thanks!

-Chris


2010/1/5 Zhongxing Xu <[email protected]>


2010/1/5 Chris Lattner <[email protected]>

On Jan 4, 2010, at 10:53 PM, Chandler Carruth wrote:

>>
>> Sorry, I didn't quite understand your point. We are already asserting the
>> QualType T is canonical on the entry to the method.
>>
>> The patch makes sure the element type is canonical when we pass it to the
>> method getUnqualifiedArrayType().
>
> I think what Chris is getting at is that the element type should
> already be canonical if the array type is canonical (by my reading of
> getCanonicalType)?

Right, if an arraytype is canonical, then its element is guaranteed to be canonical.

-Chris

I see. I added the assertion.
This code still crashes clang:

$ clang -cc1 -analyze -checker-cfref crash.c

 #include <string.h>
typedef unsigned char Byte;
void doit (char *data, int len) {
    if (len) {
        Byte buf[len];
        memcpy(buf, data, len);
    }
}


The problem is that the canonical type of type 'Byte' is itself.


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to