Hello,

I have tried another small SmPL script out.

@show_modification_before_memory_release@
expression value;
identifier element, var;
@@
 <+...
*var->element = value;
 ...+>
 free(var);


This approach is working to some degree.
Now I would like to support more possibilities for the determination
of affected members from the shown variable.


@show_modification_before_memory_release@
expression element, value;
identifier var;
@@
 <+...
*var->element = value;
 ...+>
 free(var);


elfring@Sonne:~/Projekte/Miller/lokal> spatch.opt -sp-file 
~/Projekte/Coccinelle/janitor/show_modification_before_memory_release1.cocci 
c/containers/hss.c
init_defs_builtins: /usr/local/lib/coccinelle/standard.h
101 108
Fatal error: exception Failure("minus: parse error: \n = File 
\"/home/elfring/Projekte/Coccinelle/janitor/show_modification_before_memory_release1.cocci\",
 line 6, column 6,  charpos = 101\n    around = 'element', whole content = 
*var->element = value;\n")


How can this source code analysis be improved?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to