[Cocci] Control flow query across files

Julia Lawall julia.lawall at lip6.fr
Thu Mar 28 14:10:37 CET 2013


On Tue, 26 Mar 2013, LANCIA Julien wrote:

>
> Hello,
>
> I’ve stumbled accross coccinelle and I’m interested in using it to perform queries on the control flow graph
> (quite similarly to what have been done in “Finding Error Handling Bugs in OpenSSL using Coccinelle” by Lawall
> and al.).
>
> However, I wonder if it is possible to perform queries on the control flow graph that span across a single C
> file.
>
>  
>
> An example to be clear:
>
>  
>
> fileA.h : f(), g(), h()
>
> fileA.c : f() calls g() calls h() calls i()
>
>  
>
> fileA.h : i() j() k()
>
> fileA.c : i() calls j() calls k()
>
>  
>
> Is it possible with coccinelle to match the query
>
> f()
>
>>
> k()
>
>  
>
> that spans across fileA.c and fileB.c ?

No, ... doesn't work that way.  You can use the iteration facility to do
interprocedural analysis.  If you have the coccinelle source code, you can
see an example in demos/iteration.cocci

julia


More information about the Cocci mailing list