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!

-- 
Francis Galiegue, [email protected]
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to