[cfe-dev] CFG blocks and variable scope

Ted Kremenek kremenek at apple.com
Sat Mar 28 11:48:07 PDT 2009


On Mar 28, 2009, at 11:33 AM, Martin Doucha wrote:

> Hi,
> I'm trying to write a static analysis for checking if pointers to  
> local
> variables leave the scope where the variable exists (and therefore
> become invalid). I've figured how to use DataflowSolver for this but I
> can't figure out how to find out in which CFG blocks the local  
> variable
> in question still exists. Is this info available somewhere or do I  
> have
> to hook into CFG builder and generate it myself?
>
> Regards,
> Martin Doucha

Hi Martin,

There is currently no scope information in the CFG (or the AST for  
that matter).  Adding this information would be extremely useful, and  
would probably tie in for eventual support for encoding calls to C++  
destructors in the CFG as well.

Ted



More information about the cfe-dev mailing list