[cfe-commits] r61147 - in /cfe/trunk: lib/Analysis/CFRefCount.cpp test/Analysis/uninit-vals-ps.c

Zhongxing Xu xuzhongxing at gmail.com
Tue Mar 10 21:33:16 PDT 2009


On Wed, Mar 11, 2009 at 12:31 PM, Zhongxing Xu <xuzhongxing at gmail.com>wrote:

> This scheme looks great to me! Two points:
>
> a. Symbolic regions may have types. For example: void foo(char* buf) {...}.
> 'buf' => SymbolicRegion with type char*
>
> b. Applying the scheme to your test case:
>
> // <rdar://problem/6451816>
> typedef unsigned char Boolean;
> typedef const struct __CFNumber * CFNumberRef;
> typedef signed long CFIndex;
> typedef CFIndex CFNumberType;
> typedef unsigned long UInt32;
> typedef UInt32 CFStringEncoding;
> typedef const struct __CFString * CFStringRef;
> extern Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType,
> void *valuePtr);
> extern CFStringRef CFStringConvertEncodingToIANAC
> arSetName(CFStringEncoding encoding);
>
> CFStringRef rdar_6451816(CFNumberRef nr) {
>   CFStringEncoding encoding;
>   // &encoding is casted to void*.  This test case tests whether or not
>   // we properly invalidate the value of 'encoding'.
>   CFNumberGetValue(nr, 9, &encoding);
>   return CFStringConvertEncodingToIANACharSetName(encoding); // no-warning
> }
>
> We would have to invalidate a TypedViewRegion(void*,
> VarRegion('encoding')). Then StoreManager should canonicalize it to
> VarRegion('encoding').
> Does that mean we have a new rule for canonicalization of discarding void*
> typed view besides discarding typedefs? That is, void* typed view is another
> kind of 'sugar' like typedefs?
>
>
My concern for not having consistent rules is because this. Would we have
more rules like this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090311/75b96393/attachment.html>


More information about the cfe-commits mailing list