[cfe-dev] MallocChecker/RetainCountChecker bind symbol invalidation logic

Anna Zaks ganna at apple.com
Wed May 23 10:17:12 PDT 2012

On May 23, 2012, at 12:58 AM, Tom Care wrote:

>>> class->method() //; escapes, unless method is const?
>>> bar(); // escapes - conservative - bar may have class pointer
>> I am not following this one. If 'bar()' is just any function, how does it have 'class' pointer? Is 'class' global?
> I was a bit vague here. My point was that by taking the conservative view, 'bar' may have had access to 'class' at some point and retained the pointer.

Are you assuming class is a global here? 

If 'class' is a local, I don't see how 'bar' can modify it. 
If 'class' is a global and we don't know anything about bar(), we should assume that the pointer escapes.

> It may not even respect constness (due to a const cast) or field visibility (friend class/function) etc. Without doing more interprocedural analysis or having a complete view of the code, it would be hard to make assumptions without leading to false positives.

>>> Tom
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120523/96f88ead/attachment.html>

More information about the cfe-dev mailing list