[cfe-commits] r74407 - in /cfe/trunk/lib/Analysis: BasicStore.cpp RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Jul 2 22:36:55 PDT 2009


On Thu, Jul 2, 2009 at 5:47 AM, Ted Kremenek<kremenek at apple.com> wrote:
> On Jun 30, 2009, at 7:26 PM, Zhongxing Xu wrote:
>
>> int *p = 0x1111;
>> *p = 3;
>
> Hmm.  I ran this test case through clang-cc running in gdb and couldn't get
> either 'return' site in BasicStore.cpp/RegionStore.cpp to hit using this
> test case.

I can hit in both case. Please try again.

>
>>
>> But I haven't saw it in real code. So I didn't add a test case.
>
> I think we need a test case for this one.  Even if it doesn't happen in real
> code, the analyzer should gracefully handle even weird code (even if the
> analyzer doesn't do something smart).  In this case you were fixing a crash,
> so having a test case is just good so that it cannot possibly surprise us
> later if we regress on handling it correctly.

Test case added.

>
>> Like
>> you suggest before, such cases should be handled in evalLocation for
>> null pointer check.
>
> Sure, but that is something we can change later.  Since the logic is already
> in the tree, we should have a test case for it.
>
>>
>> On Wed, Jul 1, 2009 at 3:47 AM, Ted Kremenek<kremenek at apple.com> wrote:
>>>
>>> Hi Zhongxing,
>>>
>>> Do you have a test case to accompany this patch that can go in the test
>>> suite?  It's not 100% clear to me how this gets triggered.
>>>
>>> Ted
>>>
>>> On Jun 28, 2009, at 3:16 AM, Zhongxing Xu wrote:
>>>
>>>> Author: zhongxingxu
>>>> Date: Sun Jun 28 05:16:11 2009
>>>> New Revision: 74407
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=74407&view=rev
>>>> Log:
>>>> Do not crash on binding concrete integer location.
>>>>
>>>> Modified:
>




More information about the cfe-commits mailing list