> I get nothing Given that patch (which does not include ‘home_replace’ in the regex), that would be the expected result. Note that I didn’t include the full list of functions in my last patch (not to make it more confusing than necessary), but the actual patch I’m using contains all functions, including ‘home_replace’.
In any case, I’ve just realized the problem could be not in spatch, but in how I’m parsing its output through vim’s errorformat. So, please, forget about this by now, and sorry for the noise. If I do isolate a real failure in spatch, I will get back to you with a complete set of patch/source to reproduce it. Thanks. > On 22 Jan 2015, at 12:52, Julia Lawall <[email protected]> wrote: > > With the following source code: > > int main() { > p = home_replace(NULL, files[i]); > if (p != NULL) { > free(files[i]); > files[i] = p; > } > } > > and the following semanticpatch: > > @@ identifier func =~ "^(vim_strsave|list_alloc)$"; identifier var; > statement S; expression E; @@ > > var = func(...); > ... when != var = E > * if (var != NULL) > S > > I get nothing. If I remove the regular expression, then I get results > with the above semantic patch and with the following semantic partch: > > @@ identifier func =~ "^(vim_strsave|list_alloc)$"; identifier var; > statement S; expression E; @@ > > var = func(...); > ... when != var = E > * if (var != NULL) S > > Probably the issue inmy case is the kind of regular expression being used. > Are you using pcre? > > julia _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
