[cfe-dev] MallocChecker/RetainCountChecker bind symbol invalidation logic
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.
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev