diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-01-14 17:41:54 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2012-01-14 18:05:46 -0500 |
commit | 29a36d4dec6cf7ad72e6e3337bf954096cbbb4cf (patch) | |
tree | 15ac5f3d0df3f56f233603e8626b5d383e6ab278 /scripts/coccinelle/free | |
parent | fb3f8af4ff52faf9b31e6c4e8ca0b0b16332808c (diff) |
scripts/coccinelle: improve the coverage of some semantic patches
This patch ensures that all semantic patches in the scripts/coccinelle
directory provide the report option. Report messages that include line
numbers now have the line number preceded by "line" for easier subsequent
processing.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/coccinelle/free')
-rw-r--r-- | scripts/coccinelle/free/kfree.cocci | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/coccinelle/free/kfree.cocci b/scripts/coccinelle/free/kfree.cocci index f9f79d9245ee..d9ae6d89c2f5 100644 --- a/scripts/coccinelle/free/kfree.cocci +++ b/scripts/coccinelle/free/kfree.cocci | |||
@@ -5,9 +5,9 @@ | |||
5 | //# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument | 5 | //# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument |
6 | /// | 6 | /// |
7 | // Confidence: Moderate | 7 | // Confidence: Moderate |
8 | // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. | 8 | // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2. |
9 | // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. | 9 | // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2. |
10 | // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. | 10 | // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2. |
11 | // URL: http://coccinelle.lip6.fr/ | 11 | // URL: http://coccinelle.lip6.fr/ |
12 | // Comments: | 12 | // Comments: |
13 | // Options: -no_includes -include_headers | 13 | // Options: -no_includes -include_headers |
@@ -23,7 +23,7 @@ position p1; | |||
23 | kfree@p1(E) | 23 | kfree@p1(E) |
24 | 24 | ||
25 | @print expression@ | 25 | @print expression@ |
26 | constant char *c; | 26 | constant char [] c; |
27 | expression free.E,E2; | 27 | expression free.E,E2; |
28 | type T; | 28 | type T; |
29 | position p; | 29 | position p; |
@@ -37,6 +37,10 @@ identifier f; | |||
37 | | | 37 | | |
38 | E@p != E2 | 38 | E@p != E2 |
39 | | | 39 | | |
40 | E2 == E@p | ||
41 | | | ||
42 | E2 != E@p | ||
43 | | | ||
40 | !E@p | 44 | !E@p |
41 | | | 45 | | |
42 | E@p || ... | 46 | E@p || ... |
@@ -113,5 +117,5 @@ p1 << free.p1; | |||
113 | p2 << r.p2; | 117 | p2 << r.p2; |
114 | @@ | 118 | @@ |
115 | 119 | ||
116 | msg = "reference preceded by free on line %s" % (p1[0].line) | 120 | msg = "ERROR: reference preceded by free on line %s" % (p1[0].line) |
117 | coccilib.report.print_report(p2[0],msg) | 121 | coccilib.report.print_report(p2[0],msg) |