[cfe-dev] CFGElement changes and initializers addition (with patch)
Zhongxing Xu
xuzhongxing at gmail.com
Mon Aug 23 19:41:59 PDT 2010
2010/8/20 Ted Kremenek <kremenek at apple.com>:
> On Aug 19, 2010, at 11:34 PM, Marcin Świderski wrote:
>
>> Location where the destructor was called won't be needed much I suppose. Instead of explicitly giving this position we could provide means of calculating it. If this would be 'kay I think that I can squeeze everything into one PointerIntPair.
>
> It will be needed by analyzer diagnostics. As long as we can reconstruct it when necessary that's fine by me.
>
>>
>> One thing that would be needed and could be questionable (I think) would be end of scope element. This element wouldn't have start of scope element counterpart, and it would be used only if sequance of destructors for automatic objects would not end with block termination statement. CFG clients would have to ignore it always as it would be of no use to them.
>
> I'm not quite certain what this means. We can have a block that contains a bunch destructor calls with a single successor to the block in the outer scope. An explicit "end scope element" isn't strictly needed.
>
Sorry for the late reply. There is a case where we need explicit scope
delimiters. We need them to detect resource leaks accurately. Consider
code:
void f() {
{
}
}
More information about the cfe-dev
mailing list