[cfe-commits] r71548 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h include/clang/Analysis/PathSensitive/SVals.h include/clang/Analysis/PathSensitive/Store.h lib/Analysis/CFRefCount.cpp lib/Analysis/RegionStore.cpp lib/Analysis

Zhongxing Xu xuzhongxing at gmail.com
Tue May 12 20:07:45 PDT 2009


2009/5/13 Ted Kremenek <kremenek at apple.com>:
>
> On May 12, 2009, at 9:56 AM, Ted Kremenek wrote:
>
>> On May 12, 2009, at 3:10 AM, Zhongxing Xu wrote:
>>
>>> +++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Tue May 12
>>> 05:10:00 2009
>>> @@ -161,6 +161,11 @@
>>>   return St;
>>>  }
>>>
>>> +  virtual const GRState* setDefaultValue(const GRState* St,
>>> +                                         const MemRegion* R, SVal V) {
>>> +    return St;
>>> +  }
>>> +
>>
>> Hi Zhongxing,
>>
>> I noticed the addition of this method to StoreManager, but I don't quite
>> know what it does.  Could you add some comments?  I see it used later, but I
>> cannot quite evaluate the approach without a little more context.  Thanks!
>>
>> Ted
>
> I think I understand.  'setDefaultValue' installs a default value for a
> MemRegion (e.g., representing an array) that will be used when no value is
> available for a specific element of that region.  Is this the right
> approach?  This basically assumes that all elements within that region have
> the same value.
>

Now setDefaultValue sets a conjured symbolic value to the array
region. When retrieving the element, we create a new SymbolRegionValue
for that element region.

The meaning of setting a conjured symbol is not that the whole array
has the same symbolic region, but just mark that array to be
'symbolic'.




More information about the cfe-commits mailing list