Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Checking data structure modification with SmPL
@ 2015-08-18 11:34 SF Markus Elfring
  2015-08-22 14:17 ` Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: SF Markus Elfring @ 2015-08-18 11:34 UTC (permalink / raw)
  To: cocci

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 at 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-22 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 11:34 [Cocci] Checking data structure modification with SmPL SF Markus Elfring
2015-08-22 14:17 ` Julia Lawall
2015-08-22 15:58   ` SF Markus Elfring
2015-08-22 16:05     ` Julia Lawall
2015-08-22 16:50       ` SF Markus Elfring
2015-08-22 19:07         ` Julia Lawall
2015-08-22 20:01           ` SF Markus Elfring
     [not found]             ` <alpine.DEB.2.10.1508221303590.2446@hadrien>
2015-08-22 20:50               ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox