On Sun, 29 May 2011, Francis Galiegue wrote:

> Yep, still playing...
> 
> The patch has evolved, and I have tried using "fresh identifier" instead, as 
> in:
> 
> ----
> @r exists@
> identifier fn;
> expression r;
> @@
> 
> fn(...)
> {
> ...
> r = newvstralloc(r, ...)
> ... when any
> }
> 
> @t1@
> identifier r.fn;
> expression x, e1;
> fresh identifier tmp = "tmpbuf";
> @@
> 
> fn(...)
> {
> + char *tmp;
> ...
> }
> 
> @@
> identifier r.fn;
> expression x, e1;
> identifier t1.tmp;
> @@
> 
> fn(...)
> {
> <...
> - x = newvstralloc(x, e1
> + tmp = g_strconcat(e1
>   , ...);
> + g_free(x);
> + x = tmp;
> ...>
> }
> 
> // etc
> ----
> 
> The problem: when issuing the spatch command with the -dir option, the
> generated identifier is different in two consecutive files within this
> directory (tmpbuf0, tmpbuf2, etc)... Even though the context cannot be
> the same, since I explicitly specify that this identifier should be
> created in the scope of a particular function!

It doesn't make any effort to be intelligent in this regard.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to